Re: Benchmark results for require vs require_once with and without APC (hard numbers for the allfiles.php debate)

From: Date: Wed, 11 Jul 2007 06:12:12 +0000
Subject: Re: Benchmark results for require vs require_once with and without APC (hard numbers for the allfiles.php debate)
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47419@lists.php.net to get a copy of this message
On Tue, 10 Jul 2007 07:53:30 -0700, Travis Swicegood <development@domain51.com> wrote:
Adam Ashley wrote:
I get the exact opposite to your benchmarks. my files are exactly the same as those described by you with one major difference, require.php is done in a way closer to the intended behaviour of the coding standards. it has only a single require for the file to be pulled in. The entire point of the changes are to get to the point where every file from PEAR is attempted to be included once and only once. If you need DB for Auth, Config and Auth_PrefManager you place
That's not possible - as has been acknowledged by some of the examples: <?php // Auth.php if (!class_exists('DB')) {
       throw new Auth_Exception("DB isn't loaded");
} That's the reason I did the class_exists() call. You either do that to keep from throwing a fatal error, or you do another require_once. require_once is the problem here. I have a feeling that anything that's implemented removing all require_once calls from PEAR2 is going to hang around the neck of the PEAR Group the way that PEAR_Error hangs around PEAR in general. Does no one remember how ugly if(PEAR::isError($someObj)) is in the code?
I reworked my tests and it still comes out faster without the require_once. http://www.adamashley.name/stuff/require-benchmark.tar.bz2 for all code and results and see my earlier email for detailed summary Adam Ashley

« previous php.pear.dev (#47419) next »