views:

534

answers:

6

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?

A: 

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.

Sean McSomething
A: 

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!

KyleFarris
not reading your answer is a best choice for me.
waney
I don't understand why people feel compelled to mention CodeIgniter when someone posts about optimizing Zend. Does it occur to anybody that speed and "weight" is not all that matters? Don't sacrifice sound engineering for something that you can improve artificially (speed).
mike
I wasn't saying that Zend is bad (it's not), I was saying other frameworks are lighter. In fact, I even provided a link that explains how to use the Zend components that you need/want within other frameworks. That's the beauty of Zend. I was just presenting another perfectly valid option.
KyleFarris
A: 

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.

Alister Bulman
+5  A: 
  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.

vartec
A: 

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.

Fedyashev Nikita
A: 

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

solomongaby