Hi,

I just made a small benchmark myself. While not completely scientific,
it raises some questions:

* I run the tests on my own laptop, running Linux / PHP 5.1.6 / Zend
Platform.

* I compared the time it takes to load and instantiate a Zend_Uri_Http
and the incubator Zend_Http_Client objects. All in all, some additional
14 files are included by these two.

* I created an __autoload() function calling only Zend::loadClass().

* I tested the framework the way it is, only __autoload()ing Zend_Uri
and Zend_Http_Client. I got 240.27 requests per second.

* I commented out all (or most of) the 'require_once' calls, letting
__autoload() do the entire work. I got 342.59 requests per second.

* I turned off my opcode caching by disabling Zend Platform.
__autoload() was still loading the files. I got 64.30 requests per second.

* I left opcode caching off, but enabled back the 'require_once' lines,
so __autoload() was only loading 2 files. I got 48.50 requests per second.

I think this is interesting, because despite what I've been hearing,
__autoload() plays *really* nice with opcode cache, boosting baseline
performance around x6 times. Also, it seems that with opcode cache
__autoload is even faster then require_once().

I will run some more accurate benchmarks if people find it interesting -
but I wonder where did the notion that __autoload() and opcode caching
doesn't work together came from. Can anyone provide a reference or
explanation?

TIA,

Shahar.



Christian Szardenings wrote:
> 
> Hi,
> 
> 
>> Jup...
>> I once heared it does not work, but had no time to proove since then.
>>
> 
> I've tested it with a site which is currently under development. The
> page tested simply displays a template (using Smarty)
> (tested on a DELL Xeon 2.8 GHz/1MB, 2GB Ram, SCSI 10kprm drive, under
> production load).
> 
> It seems that APC is caching the classes altough using the
> Zend::loadClass stuff.
> 
> The results (average):
> 
> without-APC
> 0.026ms
> 
> with-APC
> 0.011ms
> 
> 
> 
> Greetings
> Christian
> 
> P.S: pprofp traces can be found here: http://neu.easyflirt.de/trace.txt
> 
> 
> 
> 
> -- 
> bitrockers GmbH     www.bitrockers.de
> Moerser Str. 14a      40667 Meerbusch
> T. 01805/200 248    F. 01805/200 249*
> (* 12ct/min aus dem dt. Festnetz)
> 

Reply via email to