|
Ruby on Rails is new MVC-based web application development platform, which has few significant advantages comparable to other web development technologies like PHP, JSP or ASP.NET:
- Ruby language syntax makes it possible to write less lines of code to get same result
- strict MVC framework assures good code structure and lets involve more developers in the same project achieving better turnaround times
- scaffolding makes it possible to build low cost prototypes
- built-in support for various tests posivitely affects the quality
Main disadvantages are complexity of Ruby language and low performance (mainly due to the heavy ORM library used in Rails).
Due to the shortage of developers familiar with Ruby on Rails iDeveloperNetwork have built its own educational course in order to make existing developers familiar with Ruby on Rails, which includes:
- several case-based tutorials
- number of ‘bugfix’ or ‘modification’ tests that developer should do in a short time on our interactive_coder_assessment_solution
- knowledge base which contains non-obvious solutions already provided by our developers for typical problems
To address the performance risks, we have compared benchmarks for PHP and Ruby on Rails applications, providing same functionality.
As a result we can say that Ruby on Rails is 3-4 times slower then PHP.
At the moment we are running few projects based on Ruby on Rails, which should soon appear on Our representative projects page.
|
Ultimate Ruby on Rails vs PHP benchmarks |
|
We’ve run serie of tests and here are the results of comparison between Ruby on Rails and PHP productivity.
We have used Celeron 1.7GHz server with 512 Mb RAM with Linux RedHat FC1.
Versions of software that we have used are:
- Apache 2.x
- PHP 4.3.1
- MySQL 3.23
- Ruby 1.8
- Rails 1.1.6
- Ruby on Rails integrated with Apache through FCGI
- APC 3.0.12p2
Tests were:
- Simple page with 900 random 4-digit numbers in a table. Total size around 10 Kb. Sessions stored in files, and session files were removed before each test run.
- Typical “edit user profile” page with generates 6 requests to the database – one of the user itself and another 5 to retrieve lookup tables and some other info. Sessions stored in files and session files were removed before each test run.
- Same as 2 but database requests and sessions were cached by Univca (http://static2.livenation.com/opensource/univca/index.html). Univca was restarted before each run.
- Same as 2 but database requests and sessions were cached by Memcached (http://www.memcached.com). Memcached was restarted before each run.
PHP and Ruby on Rails code is similar. For PHP we have used Codeigniter – an opensource MVC framework.
We have run 3 series of tests: Ruby on Rails, PHP and PHP+APC. APC is the cache module that increases PHP performance.
Here are the results. All values are hits per second.
Tests |
Ruby on Rails |
|
|
test 1
no database sessions kept in files |
39.09 |
21.42 |
44.44 |
test 2
database not cached sessions kept in files |
4.56 |
9.33 |
15.60 |
test 3
database and sessions cached with Univca |
5.71 |
10.88 |
20.95 |
test 4
database and sessions cached with memcached |
5.69 |
9.87 |
19.18 |


|