On Apr 24, 2004, at 10:17 AM, Alan Knowles wrote:
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.
A nitpick - apc now uses device/inode information and not the file name as hash keys. It's no less or more expensive before, both require an equivalent of realpath() (actually in the apache case the new version is twice as efficient as the old - thanks rasmus).
I'm undecided on whether or not this one-file-per-class proposal is wise. On one hand, the number of people the 'slowdown' will be tangible to is really pretty small. You need to be doing a significant amount of requests per second to really feel this pain. On the other hand, the mere perception that it's 'slow' or 'inappropriate for large apps' may be something of a death knell in and of itself.
George
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php