Re: clarification on the performance of require_once and APC
| From: | Gopal V | Date: | Sun, 26 Aug 2007 07:37:12 +0000 |
| Subject: | Re: clarification on the performance of require_once and APC | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47836@lists.php.net to get a copy of this message | ||
Gregory Beaver wrote:
* Gopal's fix to include_once in APC 3.0.14 *does* improve the performance of relative include_once when compared to absolute include_once (http://t3.dotgnu.info/blog/php/include_once-mostly-harmless.html)For multiple calls of include_once. Only after the first one does the short-circuiting kick in.
* Gopal's fix to include_once in APC 3.0.14 does *NOT* improve the performance of include relative to include_once - include_once even with apc_stat=0 is still slower than includeSays so in the blog entry, in the last paragraph.
* autoload is slower than direct unconditional include because it is processed at runtime in the exact way a conditional include is processedIs slightly different with __autoload as it results in all classes being statically inherited because lookup for a parent does a recursive compile. While conditional includes sort of result in dynamic inheritance.
=> set up include_path/__autoload() => custom allfiles.php. In addition, creating a customized allfiles.php is relatively easy if autoload is possible. Simply use __autoload() and set up a shutdown function that var_dumps() get_included_files().I sort of started trying to do something similar with this http://t3.dotgnu.info/blog/php/inclued-gives-you-clue.html
pyrus install PEAR2_PackageName PEAR2_PackageName installed into /full/path/to/pear2/ - read README.PEAR2_PackageName to get startedNobody reads the READMEs :)
the README would contain instructions on using allfiles, or on using __autoload(). This file could be autogenerated at packaging time for packages that don't have a customized one, as it would be the same for most packages.Cross package dependencies - allfiles.php from multiple packages might have common files in them. I've been trying to play with phar:// based includes and make it play nicer with APC, which could possibly be faster than disk access for stat/path calls, being all in userspace. Cheers, Gopal -- If I learn from my mistakes, pretty soon I'll know everything.