-- Philip G <[EMAIL PROTECTED]> wrote (on Sunday, 11 May 2008, 12:25 PM -0500): > On Sun, May 11, 2008 at 11:37 AM, Matthew Weier O'Phinney <[EMAIL PROTECTED]> > wrote: > > -- Philip G <[EMAIL PROTECTED]> wrote > (on Sunday, 11 May 2008, 09:36 AM -0500): > > There's arguments on both sides of the fence on this one. I personally > like > > having organization in my code, which is why I like the multi-file > method > and > > we can just use APC to speed up code execution. However, not everybody > has that > > option, which runs into a problem. On top of that, you start relying on > your > > cache, not your code efficiency, for speedy code which, imo, is very, > very bad. > > > > Now, as far as Zend_Loader, don't use it. It completely negates the > ability to > > use APC. Zend_Loader allows dynamic loading of classes which just > happens > to > > prevent APC's ability to determine which files should be cached. Always > use > > require/include for your classes, that way you can use APC and its > features. > > Zend_Loader is convenient, but it's not worth the overhead it gives. The > only > > situations I use Zend_Loader is during factor class creations. That's > it. > > Philip, this is simply not true in PHP >= 5.2.0. PHP 5.2.0 added a > realpath cache, and Zend_Loader performs very well under both APC and > Zend Platform on those versions -- typically within a few percentage > points of a straight require_once. We will be releasing figures in the > coming months showing real-world benchmarks of this. > > I'd be very interested in seeing those results.
Ralph and Stas are working on getting something no later than 1.6.0; I believe they are also going to publish the test suite so that others can run the tests independently. > The typical source regarding APC and optional requires is a post by > Rasmus that is *SEVERAL* years old and predates the realpath cache. If > you have any up-to-date information that proves me wrong, please post > it, including methodology. > > Try several months: > http://blog.digitalstruct.com/2007/12/23/zend-framework-performance-zend_loader > / > http://blog.digitalstruct.com/2007/12/24/accelerators-revisited/ > > I'd be quite curious to see if things have changed. Those posts were the catalyst for some changes to Zend_Loader that were released with 1.0.3 and later versions. Before these versions, we were checking to see if the file being loaded was readable, which introduces an additional stat call, and thus slows things down); we now go directly to include_once (which has its own issues, but performance is not one of them). So, yes, there *have* been changes to Zend_Loader, and I will contact the owner of that blog to have him re-run the tests with a more recent version of ZF. Regardless, you ignored the next paragraph I wrote, which stated this: Finally, despite any performance considerations of Zend_Loader and/or require_once, the fact of the matter is that loading the files for your application is going to be a small fraction of any site that utilizes databases or web services. Let's be performance conscious, but not go overboard on it. Use an opcode cache, a recent PHP version, and worry about the real performance bottlenecks -- data access and retrieval. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
