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 开发者_Python百科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.
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
I am not a fan of Framework Benchmarks for the reasons given in
- Padraic Brady's Blog: PHP Framework Benchmarks - Entertaining But Ultimately Useless.
Benchmarking a Hello World Application is as pointless as can be. If you want meaningful numbers, you'd have to pit the same real world application against itself written in another framework. And even then, it's rather a matter of which parts of the framework you utilize and how.
For instance, in ZF1 you can do lot through magic methods. These are slow. By consequently avoiding these, you can shed a few microseconds here and there. There is also a performance guide for ZF. Is it fair to take these optimizations into account when comparing against other frameworks? Need translation? Ok, use Zend Translate or PHP's gettext? Need to work with dates? Hmm, Zend_Date or DateTime?
No one says you have to use the stuff a framework gives you (it's a framework), unless this is enforced by the framework design. But if you dont have to use what the framework offers you, the speed of your application will ultimately depend on the design choices you made along the way.
i don't want to answer to correct other's believes about zend framework , i just wanted to say one of the good parts of it :
avaerage 30 reqs per seconds , or 2.5 milion page view per day , do you need that many ???
source : http://www.slideshare.net/juokaz/optimizing-zend-framework
I think comparing a CMS to a framework is like comparing apples to pears. So, only compare Kohana to Zend and Wordpress to Drupal, but don't mix the two.
here is a site that might help you decide : www.phpframeworks.com/top-10-php-frameworks
here is a page that compares the speed of some frameworks (ableit it might not be objective): www.yiiframework.com/performance/
There's a new Micro X-framework
Response time for example:
X - 2,7ms
Yii - 6,9ms
CI - 7,3ms
Zend - 19,4ms
I am unsure about the authenticity of this article, but you can give this a visit: www.hiprank.com/cakephp-vs-codeigniter-vs-django-vs-kohana-vs-symfony-vs-zend.html
kohana 99%
cakephp 91%
django 77%
zend 49%
Personally, I will definitely prefer using Kohana or CodeIgniter over anything else.
精彩评论