Re: [Coding Standards] - Some Benchmarks
| From: | Justin Patrin | Date: | Tue, 10 Jul 2007 02:41:27 +0000 |
| Subject: | Re: [Coding Standards] - Some Benchmarks | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47355@lists.php.net to get a copy of this message | ||
On 7/9/07, Chuck Burgess <demon.gene@gmail.com> wrote:
I tried to put together a helpful test fileset in order to benchmark the various require/allfiles/autoload approaches being discussed. I've been mentioning the results on IRC, but thought the mailing list might need them also: - Results of three different approaches (Basic, AllFiles, Autoload), with one set using REQUIREs, and the second set using REQUIRE_ONCEs... - averages across all fix benchmarks are all in line with each other... - minimums are too... - maximums vary a good bit...I'd suggest trying with PHP 5.2+ since it's supposed to make the require stuff faster... -- Justin Patrin- Basic use of REQUIREs throughout code: average .095s,min .078s, max .187s; - Basic use of REQUIRE_ONCEs throughout code: average .095s, min .078s, max .203s;- AllFiles containing REQUIREs: average.096s, min .078s, max .187s;- AllFiles containing REQUIRE_ONCEs: average .097s,min .078s, max .187s;- Autoload containing a REQUIRE: average.092s, min .078s, max .578s;- Autoload containing a REQUIRE_ONCE: average .094s, min.078s, max .453s; - All tests executed 1000 times each. - Test file instantiated five objects of the same class and four objects of another class... the former class goes through nine levels of REQUIREs to get to the actual functional code, while the latter class goes through three levels to get to its functional code. My tests were run at the command line on PHP 5.1.6, on CygWindows XP. The times are the "real" timestamp shown using the "time" command to execute each "php myfile.php" test.