Forum Moderators: coopster

Message Too Old, No Replies

Some PHP benchmarking tests

         

Timotheos

2:22 pm on Dec 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's some interesting bench marking here
[php.lt...]

One I found most interesting is, "Always calculate the length of the loop in advance!"

Notice that this is a live run so if you refresh the numbers change.

Tim

lobo235

5:13 pm on Dec 9, 2005 (gmt 0)

10+ Year Member



Very interesting. I always wondered if the & (reference) operator sped things up at all. It looks like it doesn't in most cases.

ergophobe

6:47 pm on Dec 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




if you refresh the numbers change.

I didn't notice that at first and was wondering why

$tmp[] = 'aaaaaaaaaaaaaaaaaaaa';

took 2390% more time than

$tmp[] = "aaaaaaaaaaaaaaaaaaaa";

Refresh and of course that changes - so much so that I'm not sure what to make of these numbers. Quite often the numbers I see belie the conclusions. I usually run a lot of iterations, which has the advantage of averaging, but the disadvantage of throwing caching and other such into the mix in terms of what's really happening.