Rasmus Lerdorf wrote:
1. The included_files list gets updated each time you include a file.  In
   order to make sure that the same file included by different paths or
   symlinks don't conflict we do a realpath() on the file to be included.

That's done by PHP, not APC, right? Does this only apply to require_once or require as well?


2. APC uses the file's device and inode as the lookup key into shared
   memory to find the opcodes for the file, so a stat has to be done on

Hmm.. If the stat on the file and the check for device/inode would be done first then you wouldn't have to do a realpath, right? But I guess that's not easily done until after the realpath check.


So yes, jumping from 20 to 30 include files could very well bring a rather
significant performance hit.

I guess that's only important if your PHP code is really simple and you don't do something like e.g. DB queries because otherwise that'd be 90% of the running time anyway, right?


I 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.

- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to