Home > Performance, PHP, Web > CakePHP vs CodeIgniter Benchmark Performance

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:

- cakephp sources

- codeigniter sources

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 :)

  1. nedu
    August 27th, 2010 at 17:39 | #1

    Soooooo??

  2. August 28th, 2010 at 17:03 | #2

    @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.

  3. wahyu
    September 24th, 2010 at 14:14 | #3

    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

  4. cosmin
    September 30th, 2010 at 09:41 | #4

    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!

  5. wahyu
    December 18th, 2010 at 19:27 | #5

    oh… mybe it will usefull for my frnd,
    bookmark…!!!

  6. Scarecrow Sprinklers
    March 16th, 2011 at 22:05 | #6

    The second link you provided for “codeigniter services” is down (for me) . can you host it on your blog ?
    Thanks!

  7. Oscar B.
    June 9th, 2011 at 07:42 | #7

    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?

  1. July 8th, 2011 at 19:49 | #1
*