Re: Re: Performance Consideration of 1 class per file
| From: | Alan Knowles | Date: | Mon, 26 Apr 2004 06:50:28 +0000 |
| Subject: | Re: Re: Performance Consideration of 1 class per file | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28349@lists.php.net to get a copy of this message | ||
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
Sérgio Carvalho wrote:
Sebastian Bergmann wrote:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comChristian Schneider wrote:Before tackling a problem that is probably imaginary: Does anyone have any hard numbers proving that including two files is slower than including one file, for a fixed amount of source code? I'd guess the largest time used while including is used in compilation, and this should be dependent on source code size, not file count. Sérgio CarvalhoI guess someone _that_ considered about performance could easily do a cat *.php | grep -v require | php -w >app.lib or the like and include app.lib.Maybe the PEAR Packager / Installer could be changed to (optionally?) create a single source file (without require/include statements) comments, whitespace) from all role="php" <file>s and use this for deployment.