-- 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. 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. 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. The only reason I can see for optimizing this by using a compile-to-a-single-file type of solution is when you're getting so many hits that doing so is going to save you money in terms of no longer needing additional _servers_ to handle load. > I like the compile() method you pointed out, Lukasz, but I'm not quite > completely sold on it yet. I can see the benefits, but there are > questions to ask on both sides of that, too > > Philip > > > On Sun, May 11, 2008 at 8:36 AM, Karol Grecki <[EMAIL PROTECTED]> wrote: > > > Did you test it with opcode cache enabled? > > It's true that lots of files are included and compiled, but that's what > you > have APC for. > > Karol > > > ukasz Bandzarewicz wrote: > > > > Hi all! > > > > During simple profiling I noticed that Zend_Loader could consume 20-25% > of > > execution time. > > It's quite obvious, because ZF has to load lots of files, but.. > > have you ever wondering about compile ZF code? Something similar to > > phpDoctrine's compile method > > (http://www.phpdoctrine.org/documentation/manual/0_11?one-page# > improving-performance)? > > > > The compile method makes single file of most used components. > Additionally > > it could remove comments and white spaces to reduce size of compiled > file. > > It could reduce slow disk operations (check if file exists, load file, > > etc.) and increase performance. > > > > What you think, is this feasible? > > > > > > -- > View this message in context: http://www.nabble.com/ > Zend-Loader-performance-tp17170525p17170545.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > > > > > -- > Philip > [EMAIL PROTECTED] > http://www.gpcentre.net/ -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
