Read the latest web development and design tips at Fred Wu's new blog! :-)
Poke me on GitHub

Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana

Disclaimer: This is a very simple, ‘Hello World’ benchmark which has no impact to any real world applications. A more thorough benchmark test (by building two real world applications) is planned. :)

Disclaimer 2:I apologise for posting such a useless benchmark (I certainly didn’t expect it to hit the DZone front page), but I think most of you missed the point. I merely posted this as a result of surprise (to me anyway). At a later stage I will conduct a much more meaningful comparison between some of the frameworks. Until then, please ignore this post. :)

Last few days I have been playing with Ruby and Rails, again.

Today, when someone was asking on a forum about the efficiency of web frameworks, I thought I’d give the few frameworks I work with some more benchmark testing.

So I went ahead and benchmarked CodeIgniter, Kohana and Rails, using a simple ‘Hello World!’ page. Now before I post any benchmark results, you should know that I have previously done a benchmark test on CodeIgniter, Kohana and CakePHP. CodeIgniter and Kohana shared similar results.

This time though, the benchmark results surprised me. Here they are, in a nutshell:

CodeIgniter: 451.53 [#/sec]
Kohana: 373.05 [#/sec]

Rails: 521.39 [#/sec]
CodeIgniter: 127.23 [#/sec]

Results are presented in requests per seconds, so the higher the better. Now, please let me explain why I have included CodeIgniter twice.

The first two benchmarks were done on MAMP which has Apache 2.0.59 and PHP 5.2.5 with Zend Optimizer and XCache enabled.

The last two benchmarks were done on OS X Leopard’s default Apache 2.2.8 and PHP 5.2.5 without Zend Optimizer or XCache. Hence the worse result for CodeIgniter.

For the Rails implementation, the benchmark was done on Passenger (aka ModRails), it is supposedly a more efficient implementation than using Mongrel.

It is very interesting to see that Rails performed faster than two of the most efficient PHP frameworks.

Framework versions used in the benchmark: CodeIgniter 1.6.2, Kohana SVN, Rails 2.0.2.

  • Digg
  • DZone
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts

Tags: , , , , , , , , ,

Comments Section

16 Responses to “Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana”

Sidebar might be covered by comments ... consider it a feature! ;)
  1. 1

    mod_rails leaks memory like never seen before.

  2. 2

    Talk about unscientific benchmark? You provide nothing, and I say nothing about computer configuration, memory use, settings, framework configuration, etc.

  3. 3

    @Richard: mod_rails is still in its early stage so I wouldn’t worry about it too much. :)

    @Fredrik: Yes it is unscientific and I am aware of it. I merely provided the results for reference only, just as I did with the previous benchmark.

  4. 4

    This says nothing about theone glaring problem with rails. Crashes. Many of them. PHP has far fewer of them.

  5. 6

    What was the benchmark app doing? Hello World or something more? Also, CodeIgniter’s ‘efficient’? Not sure about that – perhaps relative to some other big name frameworks which are wholly unoptimized for performance it is. Is that what you meant? Thanks.

  6. 7

    Unfortunately, similar to most of the benchmarks out there, it was only a simple Hello World test. I posted these results because I was surprised at the performance of Rails. I always assumed that CodeIgniter or other lightweight frameworks would perform faster. I am planning to do some more thorough benchmarking though, perhaps to build a real world application in two branches, one with CodeIgniter or Kohana, one with Rails. I am sure that will satisfy many of you. :)

  7. 9

    Benchmarking hello world is not very useful for 2 reasons:

    – You’re not using any of the real world features of any of these
    frameworks, so you’re basically just benchmarking the default
    include overhead.

    – Most frameworks are targeted at reducing development time, not
    improving performance.

  8. 10

    CodeIgniter is better. It runs very fast, you don’t have to use an ORM or even a full model if you don’t want to. It’s not preloaded with every upgrade that you don’t need. It’s easy as hell to upgrade and add extensions. In fact you just drop in a file and call it like any other library class. CODEIGNITER RUNS MEGA FASTER THAN RAILS AND DOESN’T REQUIRE EXPENSIVE HOSTING.

    For people who don’t like PHP because of the ugly syntax, hows this:

    $something equals $somethingelse

    no echo statement, no nothing. Just as easy as that.

  9. 11

    OK, it didn’t let me post my PHP code lol let’s try this again.

    ——————————————————————————

    For people who don’t like PHP because of the ugly syntax, hows this:

    >?php if($something == $somethingelse): ?<

    $something equals $somethingelse>/p<

    >?php endif ?<

    no echo statement, no nothing. Just as easy as that.

  10. 12

    LOL, you get it.

  11. 13

    this is a great benchmark, thnks

  12. 14

    Can you try benchmarking DooPHP with Rails? I found it on Dzone, another lightweight PHP framework which seems to be a lot faster than codegintor. I think Rails would be quite bloated??

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>