PHP Performance Benchmarks
11–20 of 49 posts
Re: PHP Performance Benchmarks
#12Re: PHP Performance Benchmarks
#13Re: PHP Performance Benchmarks
#142 milliseconds to compare two strings seems awfully slow.
Re: PHP Performance Benchmarks
#15I'd love to see a benchmark of: for ($i = 0; $i vs foreach($users as $user)
Re: PHP Performance Benchmarks
#16Re: PHP Performance Benchmarks
#17"PHP version 5.2.13 is running on this server" :/
Re: PHP Performance Benchmarks
#18I'd love to see a benchmark of: for ($i = 0; $i vs foreach($users as $user)
There are some similar benchmark here: http://www.phpbench.com/ Intuitively the for loop should be a lot fast as it isn't assigning anything each loop. Although in your example it may be slower because the count($users) would be ran on each iteration of the loop.
Re: PHP Performance Benchmarks
#19The bad performance of count() and the lack of difference in performance between single and double quotes came as a surprise!
That's just a guess, though, having not actually looked at the code myself.
Re: PHP Performance Benchmarks
#20I'd love to see a benchmark of: for ($i = 0; $i vs foreach($users as $user)
I just coded up a benchmark and posted the ProTip on coderwall. http://coderwall.com/p/il1tog
Fix that:
for($i = 0; $count = count($elements); $i