Sei sulla pagina 1di 2

https://www.google.es/search?client=ubuntu&channel=fs&q=zend+framework+bootstrap +performance+optimization&ie=utf-8&oe=utf-8&redir_esc=&ei=260eUb6nE9OChQeswoGIAQ 1. Don't use Zend_Application.

While Zend_App is great for creating consistent c omplex bootstraps within a standardised structure, it doesn't come without a sig nificant performance hit to baseline performance. A more direct bootstrap (typic al of ZF until Zend_App arrived) is far faster and can also be done without conf iguration files. 2. Skip using the ViewRenderer plugin. Without the ViewRenderer, you need to man ually configure Zend_View and add render() calls to Controllers. This is actuall y very simple to do and is fairly fast - fast was never really part of the ViewR enderer's genetics. 3. Use autoloading. Strip require_once calls from the framework library so unnee ded files are ignored. Replace uses of Zend_Loader_Autoloader with a not-so-craz y autoloader function. In fact, pray Zend_Loader is never used - it does a lot o f file ops that, to date, have never been explained to me as having any value. 4. Preload everything (Symfony 2 Preview does!). It buys you some performance co okies and equalises the speed baseline. Using a simple preload script is not tha t hard. -------------------------We've used ZF in a lot of high traffic sites, and we've had no issues so far. We did have to jump through a few low-hanging hoops, though. Some suggestions: use Zend_Queue to help with batch mailing use Zend_Cache whenever possible Use plugin loader cache Strip require_once calls in favor of autoloading Get rid of components you don't want. (as suggested, you would not need MVC stack for CLI / mail) We chose Sphinx in favor of Zend_Search_Lucene (enormous performance gain) The bottom line for us has been this: development time is much, much more expens ive than hardware. The flexiblity and higher re-use of code completely trumps an y minor performance losses we had to deal with. For the most part, the performan ce overhead was very fixed. -------------------------I know of several companies that use ZF in high-performance/high-load scenarios. I don't know which ones I can state and which ones I can't, but some of them ar e media companies who have to handle popular TV shows. Others handle live sporti ng events. Others are multi-billion dollar companies who need to serve their int ernal organizations. So, ZF is being used by plenty of companies who run pretty high-load sites. One of our case studies is Fox Interactive (http://framework.ze nd.com/about/casestudies) and I know of several other customers who use it for h igh-performance websites. Zend Framework MVC, out of the box, will be quite fast. My blog comes back in ab out 100ms without caching and there's a fair amount of stuff that happens on my front page. I could probably drop that down to 50ms with some internal caching ( Full page caching could drop it down to single digit ms, but then it's not touch ing ZF). -------------------------Seconding Joe's answer. I've also seen ZF deployed on a few sites handling milli ons of requests and have yet to encounter a problem. When dealing with that amou nt of traffic it's a good idea to use other strategies beyond your framework, in cluding but not limited to caching and the use of a CDN. I've found most frameworks will call or create many class instances per request which I think is what causes people to say that framework X is slow without havi

ng any real world experience with it. Any hit you take there can be easily mitig ated by using an accelerator and caching. If you already have a team of devs you've hired, I'd suggest using what they fee l most comfortable with and have the most experience with. Best case they'll be able to tune their code for that framework. -------------------------A lot of the framework, any framework really, is used for building and managing the project development but the resulting project is 'just' php, html, css etc. the same as any other php web site. So what evidence do you have, that's real ti ming against other framework and non-framework built sites not anecdotal evidenc e, that a Zend project site is slow. Edit -- answers to below -- I don't think the structure that the framework uses will hurt performance. It may be more a question of PHP being acceptable and the n how much 'overhead' is added with the site design and the optimisation of load ing say JavaScript's etc. I would imagine that using the Yui guidelines of minif ying JavaScript and CSS and loading them in the correct order and making sure th e PHP code is efficient will help. You can also use other standard things such a s DB Caching and Zend Accelerator will speed things up. One thing to be careful of would be the DB connection. The use of an ORM layer might have an impact. However back to the original question about the framework i think it is similar to asking if using Eclipse or Textmate has an effect on the speed of the resulti ng site. -------------------------http://framework.zend.com/manual/1.12/en/performance.html http://blog.astrumfutura.com/2010/02/php-framework-benchmarks-entertaining-but-u ltimately-useless/ http://stackoverflow.com/questions/10791540/zend-framework-project-without-using -zend-application/10793058#10793058 http://stackoverflow.com/questions/4016497/making-zend-framework-run-faster http://devzone.zend.com/1911/caching-of-zend-framework-application-configuration -file/ http://blog.lysender.com/2009/03/zend-framework-optimization-tips/ http://www.shawnstratton.info/slides/zendcon/#slide1 http://www.gsdesign.ro/blog/optimizing-zend-performance/

Potrebbero piacerti anche