简体   繁体   中英

what is best way to improve performance of zend framework?

zend framework has many components/services I don't need, it has many includes. All this I think slow down application. Do you know how to speed up it? may be remove not used(what is common) components, or combine files to one file?

  1. APC or eAccelerator ( APC will be included by default in future releases, so I'd recommend using it, even though raw speed is slightly below of eAccelerator)

  2. Two level cache for configuration, full-page, partial views, queries, model objects:

  3. RDBMS connection pooling, if avaliable.

Before you start worrying about actively modifying things for more performance, you'll want to check the Performance Guide from the manual. One of the simplest steps you can do is to enable an opcode cache (such as APC) on your server - an Opcode cache alone can give you a 3-4x boost .

I agree with Topbit, that you should start with code profiling. Find what is the problem.

I don't think that the problem is just because of ZF has so many files. It uses autoloading, so only files required at the moment are loaded. You definitely shouldn't split different files contents.

For many perfomance problems, caching is your friend.

Code on disk that isn't being called, doesn't take any time. The only way to see what is slow is to measure it. That said, if you aren't running an opcode-cache such as APC , then you are wasting time.

you can get a bit of extra speed by optimizing the requirements statements as stated in the optimizing help topic ... first remove all the requirements and i also recommend using pear naming and overwriting the autoloader,

  function __autoload($class) {
      require str_replace('_', '/', $class) . '.php';
  }

you can find more details here

Are you being forced to use the Zend Framework? If there is no obligation to use it, then not using it would obviously be the fastest way to speed things up. There are several lightweight PHP frameworks that don't come with all the overhead and bulk of Zend. For instance, Codeigniter, Yii, Symfony, and Kohana are all excellent choices and I know at least that codenigniter and Kohana both support the use of Zend components (for instance: Using Zend with Codeigniter ).

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM