Re: Making it easier to leverage APC
| From: | Edin Kadribasic | Date: | Sat, 02 Dec 2006 13:42:13 +0000 |
| Subject: | Re: Making it easier to leverage APC | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-4376@lists.php.net to get a copy of this message | ||
Hello,
From what I understand conditional includes are not the only probem.
Having includes use variables/constants has the same net effect:
define ("SITE_ROOT" . dirname(__FILE__));
include SITE_ROOT . "/lib/classes/MyDBClass.php";
This limitation of bytecode cache (if it indeed exists) is limiting when
it comes to the way how PHP applications can be deployed.
Edin
Marcus Boerger wrote:
> Hello Lukas,
>
> quite some time abgo i already said that the solution is to disallow class
> definition outsid eof main scope. As this would create BC issue what we
> actually should do is flag those classes who got defined in main and
> suppress them when a script runs and brings a new non main block defined
> class of the same name - but only during that request - and actually not
> caching the new one.
>
> I am also working in the direction of integrating pecl/phar with APC (though
> I have more pressuringthings to do in PHP). The idea is that the phars could
> contain the compiled code already and provide the implementation in a very
> fast way to PHP. In the end those could be loaded APC or Phar at PHP startup
> already and never be loaded again.
>
> best regards
> marcus
>
> Saturday, December 2, 2006, 12:28:01 PM, you wrote:
>
>> Hi,
>
>> I recently blogged a quote from Rasmus on how autload and front
>> controllers essentially by pass most of what APC can do to speed up PHP [1].
>
>> I am wondering if there isnt something we can do to make it possible to
>> still leverage APC. I guess one issue that APC has to deal with is the
>> fact that conditional includes essentially mean you could load different
>> implementations of the same code. This is an edge case that is obviously
>> legit, but I do not think it is very common at all.
>
>> Furthermore a lot of PHP libraries are essentially like PHP extensions
>> to the end user and I think this is why they are turning to autoload.
>> They just want the functionality to be there. So maybe we should make it
>> possible to load a set of classes into every instance automatically.
>
>> Either way we should really put out a guide on how to write code that
>> makes optimal use of byte code caches. I am not really a performance
>> expert but I am willing to take care of editing this document for final
>> consumption if people help me with making sure the content base is sound.
>
>> regards,
>> Lukas
>
>> [1] http://pooteeweet.org/blog/538
>
>
>
>
> Best regards,
> Marcus
>