Re: Performance Consideration of 1 class per file

From: Date: Sat, 24 Apr 2004 14:17:08 +0000
Subject: Re: Performance Consideration of 1 class per file
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-9536@lists.php.net to get a copy of this message
Would these changes be incorporated into PHP4, too? On a related note -- would it be possible (if not already done) to evaluate dirname(__FILE__) at "parse time", in case that gives you a performance advantage? Or is there a better way to do "real" relative includes?
theoretically, if the file is the normally the first one in the include path, then the difference is negligable. Having had a detail look at APC & the engine, other than the realpath cacheing that rasmus/andi like, I think for pear, if you had an application where stat was becoming an issue, you may be better off a) using the tokenizer, pre-parse all the php code on the machine that is speed critical. Replace all the require/include calls with a extension function call, eg. a theoretical 'apc_include_file()' b) let apc_include_file, check if the file has been pre-compiled (based on the a hash lookup of the filenames) , or call the standard zend_compile code. This would work very well, only assuming you didnt a) dynamicaly create files frequently b) depend on global variables (eg. without $GLOBALS) c) have any kind of strange symlinks Using that prinicple, you could get down to close 1 stat call per page....., however many includes you really had.. Regards Alan
Cheers, Michael
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.internals (#9536) next »