CakePHP vs CodeIgniter Benchmark Performance
Greeting everyone,
I’ll post today anotherĀ benchmark result which compare CakePHP versus CodeIgniter, 2 popular php framework that help coder building their site quickly.
I’m not an expert with PHP framework, since there are so many and they evolute everyday, so I’m not posting here to present another vague comparison on “which framework is the best” and “why to choose one instead of another”…
On this post, I only want to display server’s performance comparison between cake and CI.
The test will create a variable “hello world” in the controller, and then display it in the view (pretty simple), no cache (except APC opcode), blank page with variable to be displayed.
Versions I’ve been using for this test are:
- CakePHP 1.3.3
- CodeIgniter 1.7.2
Server Configuration:
- Macbook (Intel Core2 2,4Ghz / 2Gb RAM)
- PHP 5.3.3 (with APC)
- Apache 2.2.15
Code for this test can be downloaded here:
I will use “ab”, Apache Benchmark Tool, using 10 concurent user during 60 seconds. (NOTE: yes, i use ab since Neotys doesn’t want to provide me a NeoLoad licence for free…)
Complete requests:
- CakePHP: 3450 hits
- CI: 32544 hits
Requests per second:
- CakePHP: 57.50 [#/sec]
- CI: 542.37 [#/sec]
longest request
- CakePHP: 897 ms
- CI: 1997 ms
Enjoy
Soooooo??
@nedu
So it’s pretty obvious that cakephp takes longer time to display “hello world” than codeigniter.
Reasons for this is probably the amount of class and the db connection established by cakephp by default for every hit.
I’ll try to get additional info about it using xdebug profiler.
why you must use php framework just for “hello world” ? you can use only html to do that, if you want to compare php framework i think you must create some case
Hi Pierre!
I am a CakePHP developer and I am not familiar with CI’s internals.
One question I have is if you enabled Cake’s model caching so it doesn’t do the DESCRIBE queries and ofcorse if you set the debug level to 0. More about optimizing Cake here (http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/)
Thanks for the benchmarks!
oh… mybe it will usefull for my frnd,
bookmark…!!!
The second link you provided for “codeigniter services” is down (for me) . can you host it on your blog ?
Thanks!
This is the common error that many many people fall into: benchmarking frameworks on a “Hello World” use case.
This is absolutely useless since no one will use a framework for a such task.
What about a List, insert, update, delete mini app?