Search code examples
zend-frameworkperformancekohana-3

PHP Framework Speeds (Zend, Kohana)


I'm new to OOP and frameworks, I've just gotten started with Zend and learned about Kohana 3 today, a smaller, more lightweight and "faster" framework. I probably don't even need all the features Zend has to offer and might make more sense to use Kohana. However, Zend seems to have more documentation, and somehow it seems easier for me to use.

Now what I'm wondering is when people say Kohana is "fast" and when people say Zend is "slow", how fast and how slow are they? I'm not sure if you can compare it this way, but if I'm on a hosting plan that let's say can have 100 concurrent users with Kohana, with Zend (since it's slower), would I only be able to have about 90 users? Is the difference that small, or would it be something like 100 to 50?

Also, when people call Zend slow, they are mostly relating to frameworks right? Once again it might be hard to compare, but is Zend slow compared to say a CMS like Drupal or Wordpress?

It might be just basic estimates but do you think you can sort of show what you think may be the difference by showing a number besides the framework/CMS, it's easier for me to understand this way.

For example:

Kohana - 100 (fastest)
Zend - 70
Wordpress - 60
Drupal - 40 (slowest)

Edit: I agree that speed isn't everything which is the reason I'm still leaning towards sticking with Zend. I'm just curious to know how much faster Kohana really is. It looks like it's at least twice as fast. Now I just wonder how slow Zend is compared to a CMS. Let's say I have a basic user and content system with Zend vs. Drupal out of the box, Zend should still be at least faster than Drupal right? I've used Drupal before and it's quite slow... As long as Zend is faster than Drupal, I think I'll be happy.


Solution

  • Yes, Zend is slow compared to some other frameworks, Kohana included. However, you may ask yourself if speed of the framework is your primary concern. For many applications, ease of development trumps the additional load your servers will bear. Zend has many good features that make it a worthwhile framework and speed up development. It also has pretty good documentation and methods to unit test your code.

    Here is a recent comparision of various PHP frameworks loading a simple "Hello World" HTML page:

    Raw PHP - 740 req/sec – 100%
    PHP Pro MVC 0.0.4 - 200 req/sec – 27%
    DooPHP 1.2 – 170 req/sec – 23%
    Yii Framework 1.1.1 – 130 req/sec – 18%
    Kohana PHP 2.3.4 – 55 req/sec – 7.5%
    CodeIgniter 1.7.2 – 38 req/sec – 5%
    Zend Framework 1.10 – 24 req/sec – 3%
    

    as found on this site:

    http://www.sheldmandu.com/php/php-mvc-frameworks/php-mvc-framework-performance-part-1

    These figures are without opcode caching, which will dramatically improve the performance of your application.

    Even if you decide to go with another Framework such as Kohana, you may find the Zend Framework libraries worth using. I am particular fond of the Zend_Config, Zend_Validate and Zend_Filter libraries.

    This article may be of use to you in deciding which framework will best meet your needs:

    http://www.sheldmandu.com/php/php-mvc-frameworks/choosing-the-best-php-mvc-framework-part-1