Posted by Fred Wu
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.