Re: 1 last error to fix before the application is done!

From: Date: Tue, 14 Oct 2008 14:29:11 +0000
Subject: Re: 1 last error to fix before the application is done!
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-281877@lists.php.net to get a copy of this message
Andrew Ballard wrote:
I've heard that a lot, but I just don't see it. I'm sure some of you can come up with better tests than this, but here is what I used:
...
Based on these results, I'd hardly use the "language construct versus function call" optimization argument to make my decision. I'm not sure if this is a testament to improvements in the PHP engine over the last couple years, or if equipment has gotten fast enough that the differences have become irrelevant. Quite possibly, it's both.
There are a couple of issues with those benchmarks... 1. It uses rand()... this is generally a bad thing in benchmarks 2. It uses internal (wall clock) timing and tests different things in the same application run. 3. 50k iterations is easy! Give it something hard :) You should really use an external timing function (like "time blah" on *nix) as it shows you real processor time used, as well as wall-clock time. I've posted a simple benchmark else where on this thread that tests which prove that for a two index-depth test, !empty is approx 4.5x faster than the equiv array_key_exists tests. Even for a single depth array test, I still get ~3x speed improvement using empty() vs. array_key_exists(). Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/]

« previous php.general (#281877) next »