Hi everyone,

I made a very quick and dirty PHP speed testing system (chrelad.awardspace.com/speed) and was looking for feedback on different tests that I could add to it. I've only got two tests going right now:

Comparison of string concat/replace methods

  • Heredoc with interpolation
  • Double quote with interpolation
  • Double quote concat
  • Single quote concat
  • Heredoc with multiple str_replace's
  • Heredoc with bulk str_replace
  • Heredoc with sprintf
  • Heredoc with preg_replace

Comparison of loop methods

  • Foreach
  • Foreach with array_keys
  • For with size identified in for statement
  • For with size identified before for statement

I like that it's got graphs (using Google Charts API) and it gives me a quick way to see which method is the quickest.

I plan on adding some other tests like the following:

  • String replace/concat with larger text
  • Comparison of looping constructs with different sizes/types

Any other ideas are welcome! Also, please let me know if I'm missing anything or could improve the accuracy of these tests. If you would like to know more about the inner workings of the testing system, let me know.

By the way, the numbers may vary from page load to page load, but they seem to give the same results pretty much every time for me. Also, I'm working to get the upper number of the individual tests to show properly in the graphs. Right now, some of them just show zero for the min and max.

Thanks everyone,

Chrelad

Right now, I'm just sorting by the average time each test takes (out of twenty runs per test).

Is there a better way you can think of?

Thanks,

Chrelad

Hey sorry this is late. Is this site still running? I tried it on Chrome and none of the links work.

Heya jrivera,

Yeah, the site is still up. Which links did you try that didn't work?

The first three links are actually named anchors, so they won't take you to a different page, just down to a section of the current page. If the entire contents of the page are visible, you probably won't notice a change when you click the top three links.

The bottom three links are probably what you are looking to try; those are the links to the tests.

I also have to appologize for not adding more tests. I was hoping that I would waiting to get more feedback to determine whether it was even worth putting time into. I know there are other sites now like http://www.phpbench.com/ that offer essentially the same thing; but I still like to see a simple pie chart that tells me which solution is the fastest for a given goal.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.