问题
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! :)
回答1:
Googling brings up the two I know best:
- The PHP Benchmark
- PHP Benchmarks
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.
回答2:
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.
回答3:
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
来源:https://stackoverflow.com/questions/2530610/does-a-php-per-function-or-per-task-performance-benchmark-reference-exist