Re: Making it easier to leverage APC
| From: | Robert Cummings | Date: | Sun, 03 Dec 2006 20:09:10 +0000 |
| Subject: | Re: Making it easier to leverage APC | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-4393@lists.php.net to get a copy of this message | ||
On Sun, 2006-12-03 at 20:59 +0100, Pierre wrote:
> Hello,
>
> On 12/3/06, Robert Cummings <robert@interjinn.com> wrote:
> > On Sun, 2006-12-03 at 15:38 +0100, Pierre wrote:
> > > Hello,
> > >
> > > On 12/3/06, Lukas Kahwe Smith <lsmith@php.net> wrote:
> > > > Pierre wrote:
> > > >
> > > > > But what can be done? Should "we" stop to talk about this only
> > > > > because
> > > > > the possible confusions? :)
> > > >
> > > > I guess the key thing is to come up with a number of benchmarks that
> > > > illustrate real world scenarios. Obviously not everybody is Yahoo, so
> > > > their needs and priorities will be different. There are also different
> > > > programming paradigm that need to be looked at (front controller versus
> > > > one file per action etc.). Obviously OS platform also comes into the
> > > > mix, but I think we should try to come up with solutions/guidelines that
> > > > are as independent as possible.
> > >
> > > With all respects, I have to say that frameworks users, for the large
> > > majority, are not concerned by this "problem". If one uses 2+ includes
> > > to say "hello world", he is certainly looking at the wrong place to
> > > solve his performance problems (it sounds obvious with this example,
> > > maybe not for more "complex" task :)
> >
> > Hmmm, this is interesting stuff... I just top loaded 125 class files
> > consisting of about 200 classes and I shaved about 1/100th of a second
> > off a the load time of a page that makes heavy use of the framwork's
> > library. I used PHP 4.4.4 with eaccelerator.
> >
> > That's especially interesting to me since my framework uses a lazy
> > loading mechanism and only loads the class if it is used. So this
> > particular page would normally only conditionally load about 40 classes
> > in about 30 files.
>
> It seems that you are missing the point. I'm talking about the real
> problem, which is the conditional class declarations not the amount of
> files. And yes, if you have 125 files included (the files _are_
> cached), this exact problem (class declarations) should not be
> relevant.
I think you perhaps are missing the same point that Ilia may have
missed. Both methods are using eaccelerator as the bytecode cache. The
top load method of 125 files with some 200 classes on subsequent
requests is faster than the conditionally loaded version where only
about 30 files and 40 classes are loaded. I understand that after the
cache is made the file access time is moot (unless it needs to hit the
filesystem for the bytecode cache), but the point is 200 classes top
loaded in the cache are faster than 40 conditionally loaded classes in
the cache.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'