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 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.