Woah there hotshot! The benchmark isn’t a good indicator and shouldn’t be used to base your decision on. The CakePHP benchmarks in particular aren’t realistic. According to the CakePHP group, he didn’t enable caching and overwrote the built in pages controller.
I’m currently working on a large CakePHP application (40+ tables) and can tell you from personal experience that CakePHP performance is fine 🙂
I’d have to agree with the previous comment about using this as a deciding factor in comparing frameworks. The word ‘validate’ has a very assertive connotation. Are you saying that this set of benchmarks by itself justifies your decision? I hope you aren’t, since there’s a lot more to frameworks than raw requests per second. That said, I’m surprised that ZF did so well against CI, since the CI project emphasizes performance so much. We’ve been profiling ZF with a modified profiler that works with our opcode cache, and some simple lazy instantiation fixes should bring us very close to CI’s requests/sec. I’m also surprised that CakePHP fared so bad- I’ve never gotten the impression that it performs so poorly with the anecdotal evidence I’ve heard. Hopefully someone from the CakePHP community will modify the test app so that it’s optimally performant. In any case, I hope this is just the beginning of a conversation around performance in the most popular PHP frameworks. IMO it’s a long overdue and interesting discussion to have.
BTW, I can’t help but mention that if we took your assertion by face value, we could extend the logic to conclude that we’ve all made a terrible mistake by going with any framework at all. Basic PHP is almost *15x* as fast as the fastest of the frameworks in this comparison. But I’m sure we can all see the flaw in that conclusion. 🙂
off-course request/sec is not the only criteria why i choose CI, but you have to notice one important thing, out of box(‘without super optimization’) CI preforms better then both CakePHP & Zend Framework, and that according to me is important. remember most of the sites are build by rookee developers and for them this good enough.
and anyways think what will happen if someone optimizes CI even more.
I hope that they can optimize even more, but considering their focus on performance from the outset I’d have to guess there are more opportunities for improvement in ZF and Cake right now. We’ve built a special version of our profiler to run again an opcode-cached ZF app, and there are some very low hanging fruit for optimization. We’ll be releasing these performance fixes in the next minor release (RC1 coming very soon).
Guys, stop, stop. Lets be honest. Everyone is using Symfony, CodeIgniter and CakePHP. And if you need some crazy weird library, you copy and paste the code from one of Zend’s classes and end of the story.
It probably should be mentioned that CodeIgniter is not a PHP5 Strict framework. It is a PHP4 framework capable of running under PHP5 and what currently exists of PHP6. You can write a PHP5-only or PHP6-only application using CodeIgniter, but cannot use many of the object-oriented features introduced in PHP5 due to PHP4 legacy reasons. PHP5 has more overhead than PHP4 and runs a tad slower in my opinion. It’s possible to rewrite CodeIgniter as a PHP5 strict framework, but you will notice some speed degradation (still not as much as the other two frameworks mentioned).
The CodeIgniter documentation refers to Active Record, but the database abstraction approach was based on ADODB and its implementation of the Table Gateway pattern. The objectives of the Active Record and Table Gateway patterns are similar, but the coding approaches for the two patterns are different (oranges and tangerines).
It probably also should be noted that CodeIgniter can use most of the Zend framework libraries using the approach documented on the CodeIgniter wiki.
I started using frameworks with the advent of Mojavi 1.0 many years ago and moved on to Symfony after Sean Kerr stopped working on the Mojavi project. I’ve used CakePHP on several projects as well as several other frameworks over the years. Hands down, CodeIgniter is much faster than the other two frameworks. A close second is Kohana which started off as a PHP5-strict implementation of CodeIgniter, but became something much different as the code was refactored to support more of PHP5’s object-oriented features.
About the testing procedure, CodeIgniter uses lazy-initialization approaches to load libraries, helpers and other framework files on an as-needed basis which could be said to give it an unfair advantage in this kind of test. It would be interesting to see this test duplicated using a large database under heavy load when an equivalent number of libraries are loaded.
Hi
I have to create more than one cotrollers.
Because currently, In my controller the code size is beyound 4000 lines.
How i put this number of functions in seperate files and again make call from main controller to this functions.
I have tried one solution for this, the files are:
1. made one base controller
/application/libraries/
class MY_Controller extends Controller {
function MY_Controller() {
parent::Controller();
}
function test_sayan($xyz)
{
echo “hi hello”;
echo $xyz;
}
}
2. for developer1
/application/libraries/
<?php
class devloper1 extends MY_Controller {
function devloper1() {
parent::MY_Controller();
}
function homepage()
{
echo “troy”;
}
}
same as above i want to create more classes like developer2…..3,4,5
In which developer put his own functions
3. And finally my base controller from which i can call these functions from developers
test_sayana(’abc’);
$this->load->library(’devloper1’);
$this->devloper1->homepage();
// likely above statement can i load more libraries (developers)
// and call the functions
}
}
My question: is it way to make compact and clear code?
Hi
I have to create more than one cotrollers.
Because currently, In my controller the code size is beyound 4000 lines.
How i put this number of functions in seperate files and again make call from main controller to this functions.
I have tried one solution for this, the files are:
1. made one base controller
/application/libraries/
class MY_Controller extends Controller {
function MY_Controller() {
parent::Controller();
}
function test_sayan($xyz)
{
echo “hi hello”;
echo $xyz;
}
}
2. for developer1
/application/libraries/
load->library(’devloper1’);
$this->devloper1->homepage();
// likely above statement can i load more libraries (developers)
// and call the functions
}
}
My question: is it way to make compact and clear code?
off-course request/sec is not the only criteria why i choose CI, but you have to notice one important thing, out of box(’without super optimization’) CI preforms better then both CakePHP & Zend Framework, and that according to me is important. remember most of the sites are build by rookee developers and for them this good enough.
and anyways think what will happen if someone optimizes CI even more.
I am working on Zend Framework , i have already completed two sites.
i’ve problem using abstract class,so i used interface instead of that,can u tell me which one is better & why?
waiting for reply smart ……………………..
@shawc These performance benchmarks have been discussed rigorously in the ZF community. There are many pending concerns and questions about how these results were obtained. Please see this thread: http://www.nabble.com/Framework-speed-shotout—-question-to19914787.html#a20052829. Again, there are certainly frameworks that are more performant than others, and Zend Framework very consciously strikes its own balance of performance/functionality in the mix. But I highly recommend approaching these simple characterizations of ‘framework performance’ with skepticism, especially when all methods, configurations, and applications used are not fully disclosed. Keep in mind, frameworks are not pre-configured applications such as Photoshop or even WordPress. The ‘performance’, if such a loaded word even correctly applies here, is highly dependent on the type and implementation of the application that is used for benchmarking. I have seen results all over the board for the frameworks in this comparison across several ‘performance comparisons’, and I’ve found that they really don’t have a lot of impact on the performance of an optimized, full-featured PHP app. Also, keep in mind that premature optimization will make development much more difficult and may have no impact depending on your requirements. In fact, frameworks typically make it much easier to optimize apps in practice, since they provide an abstraction for every component of the application.
Woah there hotshot! The benchmark isn’t a good indicator and shouldn’t be used to base your decision on. The CakePHP benchmarks in particular aren’t realistic. According to the CakePHP group, he didn’t enable caching and overwrote the built in pages controller.
I’m currently working on a large CakePHP application (40+ tables) and can tell you from personal experience that CakePHP performance is fine 🙂
I’d have to agree with the previous comment about using this as a deciding factor in comparing frameworks. The word ‘validate’ has a very assertive connotation. Are you saying that this set of benchmarks by itself justifies your decision? I hope you aren’t, since there’s a lot more to frameworks than raw requests per second. That said, I’m surprised that ZF did so well against CI, since the CI project emphasizes performance so much. We’ve been profiling ZF with a modified profiler that works with our opcode cache, and some simple lazy instantiation fixes should bring us very close to CI’s requests/sec. I’m also surprised that CakePHP fared so bad- I’ve never gotten the impression that it performs so poorly with the anecdotal evidence I’ve heard. Hopefully someone from the CakePHP community will modify the test app so that it’s optimally performant. In any case, I hope this is just the beginning of a conversation around performance in the most popular PHP frameworks. IMO it’s a long overdue and interesting discussion to have.
BTW, I can’t help but mention that if we took your assertion by face value, we could extend the logic to conclude that we’ve all made a terrible mistake by going with any framework at all. Basic PHP is almost *15x* as fast as the fastest of the frameworks in this comparison. But I’m sure we can all see the flaw in that conclusion. 🙂
@richard, @wil
off-course request/sec is not the only criteria why i choose CI, but you have to notice one important thing, out of box(‘without super optimization’) CI preforms better then both CakePHP & Zend Framework, and that according to me is important. remember most of the sites are build by rookee developers and for them this good enough.
and anyways think what will happen if someone optimizes CI even more.
I hope that they can optimize even more, but considering their focus on performance from the outset I’d have to guess there are more opportunities for improvement in ZF and Cake right now. We’ve built a special version of our profiler to run again an opcode-cached ZF app, and there are some very low hanging fruit for optimization. We’ll be releasing these performance fixes in the next minor release (RC1 coming very soon).
Guys, stop, stop. Lets be honest. Everyone is using Symfony, CodeIgniter and CakePHP. And if you need some crazy weird library, you copy and paste the code from one of Zend’s classes and end of the story.
@Dany Fine by us. Just make sure you copy and paste the license while you’re at it if you plan on redistributing it. 😉
It probably should be mentioned that CodeIgniter is not a PHP5 Strict framework. It is a PHP4 framework capable of running under PHP5 and what currently exists of PHP6. You can write a PHP5-only or PHP6-only application using CodeIgniter, but cannot use many of the object-oriented features introduced in PHP5 due to PHP4 legacy reasons. PHP5 has more overhead than PHP4 and runs a tad slower in my opinion. It’s possible to rewrite CodeIgniter as a PHP5 strict framework, but you will notice some speed degradation (still not as much as the other two frameworks mentioned).
The CodeIgniter documentation refers to Active Record, but the database abstraction approach was based on ADODB and its implementation of the Table Gateway pattern. The objectives of the Active Record and Table Gateway patterns are similar, but the coding approaches for the two patterns are different (oranges and tangerines).
It probably also should be noted that CodeIgniter can use most of the Zend framework libraries using the approach documented on the CodeIgniter wiki.
I started using frameworks with the advent of Mojavi 1.0 many years ago and moved on to Symfony after Sean Kerr stopped working on the Mojavi project. I’ve used CakePHP on several projects as well as several other frameworks over the years. Hands down, CodeIgniter is much faster than the other two frameworks. A close second is Kohana which started off as a PHP5-strict implementation of CodeIgniter, but became something much different as the code was refactored to support more of PHP5’s object-oriented features.
About the testing procedure, CodeIgniter uses lazy-initialization approaches to load libraries, helpers and other framework files on an as-needed basis which could be said to give it an unfair advantage in this kind of test. It would be interesting to see this test duplicated using a large database under heavy load when an equivalent number of libraries are loaded.
Hi
I have to create more than one cotrollers.
Because currently, In my controller the code size is beyound 4000 lines.
How i put this number of functions in seperate files and again make call from main controller to this functions.
I have tried one solution for this, the files are:
1. made one base controller
/application/libraries/
class MY_Controller extends Controller {
function MY_Controller() {
parent::Controller();
}
function test_sayan($xyz)
{
echo “hi hello”;
echo $xyz;
}
}
2. for developer1
/application/libraries/
<?php
class devloper1 extends MY_Controller {
function devloper1() {
parent::MY_Controller();
}
function homepage()
{
echo “troy”;
}
}
same as above i want to create more classes like developer2…..3,4,5
In which developer put his own functions
3. And finally my base controller from which i can call these functions from developers
test_sayana(’abc’);
$this->load->library(’devloper1’);
$this->devloper1->homepage();
// likely above statement can i load more libraries (developers)
// and call the functions
}
}
My question: is it way to make compact and clear code?
Thanks
Hi
I have to create more than one cotrollers.
Because currently, In my controller the code size is beyound 4000 lines.
How i put this number of functions in seperate files and again make call from main controller to this functions.
I have tried one solution for this, the files are:
1. made one base controller
/application/libraries/
class MY_Controller extends Controller {
function MY_Controller() {
parent::Controller();
}
function test_sayan($xyz)
{
echo “hi hello”;
echo $xyz;
}
}
2. for developer1
/application/libraries/
load->library(’devloper1’);
$this->devloper1->homepage();
// likely above statement can i load more libraries (developers)
// and call the functions
}
}
My question: is it way to make compact and clear code?
Thanks
Hello r u read it?
reply something.
off-course request/sec is not the only criteria why i choose CI, but you have to notice one important thing, out of box(’without super optimization’) CI preforms better then both CakePHP & Zend Framework, and that according to me is important. remember most of the sites are build by rookee developers and for them this good enough.
and anyways think what will happen if someone optimizes CI even more.
I am working on Zend Framework , i have already completed two sites.
i’ve problem using abstract class,so i used interface instead of that,can u tell me which one is better & why?
waiting for reply smart ……………………..
@sayana NO.
Take a look Yii framework, a new framework whose performance is comparable to CI but with richer features:
http://www.yiiframework.com/performance/
@shawc These performance benchmarks have been discussed rigorously in the ZF community. There are many pending concerns and questions about how these results were obtained. Please see this thread: http://www.nabble.com/Framework-speed-shotout—-question-to19914787.html#a20052829. Again, there are certainly frameworks that are more performant than others, and Zend Framework very consciously strikes its own balance of performance/functionality in the mix. But I highly recommend approaching these simple characterizations of ‘framework performance’ with skepticism, especially when all methods, configurations, and applications used are not fully disclosed. Keep in mind, frameworks are not pre-configured applications such as Photoshop or even WordPress. The ‘performance’, if such a loaded word even correctly applies here, is highly dependent on the type and implementation of the application that is used for benchmarking. I have seen results all over the board for the frameworks in this comparison across several ‘performance comparisons’, and I’ve found that they really don’t have a lot of impact on the performance of an optimized, full-featured PHP app. Also, keep in mind that premature optimization will make development much more difficult and may have no impact depending on your requirements. In fact, frameworks typically make it much easier to optimize apps in practice, since they provide an abstraction for every component of the application.
,Wil