RE: [PECL-DEV] Making it easier to leverage APC

From: Date: Sat, 02 Dec 2006 22:35:36 +0000
Subject: RE: [PECL-DEV] Making it easier to leverage APC
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-4379@lists.php.net to get a copy of this message
I don't see a reason for byte code caches not to work with __autoload() and conditional classes already today. I don't know of the internals of APC but __autoload() should not really be an issue (it's just another include()) and I'm not quite clear why Rasmus thinks that doesn't work. As far as conditional class declerations are concerned, it's also not a huge issue. It might not be quite as fast as ones in the main block but you still get the majority of the bytecode cache benefit which is that you don't need to re-read the file, do lexical analysis and run a parser on it the code... Andi > -----Original Message----- > From: Marcus Boerger [mailto:helly@php.net] > Sent: Saturday, December 02, 2006 4:02 AM > To: Lukas Kahwe Smith > Cc: pecl-dev@lists.php.net > Subject: Re: [PECL-DEV] Making it easier to leverage APC > > 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 > > -- > PECL development discussion Mailing List > (http://pecl.php.net/) To unsubscribe, visit: > http://www.php.net/unsub.php >

« previous php.pecl.dev (#4379) next »