3

I'm running my own (albeit, basic) benchmarks in a linux-based sandbox. However, I'd love to find a per-function or per-task performance / benchmark reference or utility for comparison.

Does this exist?

Of course I've done my own fair diligence / searching and have so far come up empty handed..

(I'm primarily interested in information relevant to PHP 5.3)

Thanks very much! :)

mO_odRing
  • 1,935
  • 3
  • 15
  • 19

3 Answers3

3

You can use a profiler to evaluate which function calls are more costly.

XDebug can also provide log files that you can later load into KCacheGrind to get a nice tree output of what time was spent where in your code.

Andre
  • 3,150
  • 23
  • 23
2

Googling brings up the two I know best:

they don't do function benchmarks, though, they mostly just compare language constructs. I know at least one good site that also tests file I/O operations and the like, but I forgot the URL. I really need a central link repository :)

Update: This looks interesting, can't take a deeper look right now but there seems to be a number of interesting tests.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • The PHP Benchmark looks to be a fantastic resource, a great find Pekka. – Mark Tomlin Mar 27 '10 at 19:50
  • Reading the results on the page, 'echo vs. print' function test and reading the results. (Now this could be because I'm very tired right now, and just not parsing the results correctly.) 100% echo ' vs. 107% print ', Print is 7% Slower then Echo. 128% echo 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa' vs. 252% print 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa', Print is ~197% Slower then Echo. And yet, The quote: "The one small thing to notice is that when using a comma to separate items whilst using the echo function, items run slightly faster." is false as comma apears to be twice as slow as concating the string. – Mark Tomlin Mar 27 '10 at 19:59
  • @Mark intersting. Those are real-time tests and thus subject to the server's fluctuation, while the quote seems to be static. Reloading changes the results notably... Which can be seen as problematic, but also is realistic. One would have to run 100 loops to get average values I guess. – Pekka Mar 27 '10 at 20:51
  • Wow, very nice. Thanks! :) Oddly, I didn't come over these in my searches. I've been looking for over a week. Most I could find were articles discussing tests for single, specific issues. – mO_odRing Mar 28 '10 at 08:03
0

It doesn't contain any specific times, but it does have the Big-O for a number of array_* functions.

List of Big-O for PHP functions

Community
  • 1
  • 1
Kendall Hopkins
  • 43,213
  • 17
  • 66
  • 89