-- Jurian Sluiman <[email protected]> wrote (on Thursday, 14 May 2009, 05:55 PM +0200): > I'm recently looking into speeding up a Zend application. It looks the > bootstrap process takes a very long time. I'm using the common structure and > installed the ZFDebug toolbar (you might still know it as the Scienta debug > bar). In the Bootstrap->run() method I added a time mark before the > frontController->dispatch() method. > > > Average is the process taking 1000ms. The dispatch() method is called at > 650ms. > This means running the application is 33% of the process. Preparing the > application takes 66% of the time. Can this be shortened (e.g. by caching some > objects)? > Requesting a lot of pages shows bootstrapping is between 25% and 75% of the > total time (but more often towards 75% than 25%).
I plan on running some profiling and benchmarks soon. Some ideas off the top of my head: * You'll get much better performance if you create resource methods in your bootstrap than if you use resource plugins. * Use PHP arrays for your configuration sources when possible; these take fewer resources to load, can be cached via memcached and other technologies, etc. * Only bootstrap what you actually need for *each* request, and defer initialization of other resources until they're used. (This is the sort of thing that the resource autoloader was intended to help with, too.) Also, you'll get better and more accurate profiling from Zend Debugger or XDebug than userland debugging solutions, as they can time the individual system level calls. (Debugging in userland adds overhead that can inflate the numbers.) -- Matthew Weier O'Phinney Project Lead | [email protected] Zend Framework | http://framework.zend.com/
