Re: Re: Performance Consideration of 1 class

From: Date: Mon, 26 Apr 2004 09:04:30 +0000
Subject: Re: Re: Performance Consideration of 1 class
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-28353@lists.php.net to get a copy of this message
Based on this, I'd wager that using one class per file is better, even performance-wise. The brunt of the work is in the processing of the code (allocate/parse/compile), so any chance of not including code means time savings. Developers can only choose not to include a class if it is in a separate file. I'd leave the one file per class requirement in the RFC. Regards, Sérgio Carvalho Alan Knowles wrote:
This is very rough.. - just picked 1 test which appeared to be about average.. with APC included 228 files in 0.27688097953796s try re-included 228 files in 0.065502166748047s without APC included 228 files in 1.0808780193329s try re-included 456 files in 0.015151262283325s http://devel.akbkhome.com/svn/index.php/akpear/_scratchpad_/includetest.php Based on a on a very simple test (non-symlinked, single include path) - Using the above figures, and a bit of guesswork... - compiling/parsing takes about 60%, - allocating memory.. is probably about 30% - 1-5% is probably doing stating/filepathing.. the interesting one, is that the extra %ge time taken by APC on the second call to include_once, - which is very odd.. - considering APC shouldnt even be called on the second one.. Not suprisingly, changing to require_once, gives you 0.01-0.03s boost.. Regards Alan


Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.dev (#28353) next »