Rails 2.3 is faster

Manfred Stienstra, 06 Mar 2009, 15:54 in ruby on rails and performance, last updated 06 Mar 2009, 15:56 (edit).

This morning I was deploying an application originally built on Rails 1.1.5 which we’ve recently ported to Rails 2.3. It’s an introductory online statistics course aimed at people who study psychology and social sciences. Most of the pages serve static content straight from the database, so we were never really concerned about performance.

After I finished deploying the application I was tailing the production logs and I noticed that the application took a lot less time completing page requests than before. Just for fun I decided to run some benchmarks on my development box¹.

1.1.5 2.3.1
Login 47.3㎳ (σ = 24.5) 12.1㎳ (σ = 10.2)
Lesson index 177.6㎳ (σ = 30.4) 60.0㎳ (σ = 25.7)
Lesson show 66.5㎳ (σ = 36.1) 19.0㎳ (σ = 15.3)

Please don’t interpret these numbers as Rails 2.3 is three times faster, because that’s not what these numbers mean. However, when you port you application to Rails 2.3 your server load will very likely go down.

¹ Mac Pro, 2 x 2.8 Ghz, 4 GB 800 Mhz DDR2. Apache with Passenger 2.1.0 & MySQL 5.1. Applications were running in production. Benchmarks were generated with Apache Bench with concurrency 5 and 2000 requests.

Comments

Add your comment

In order to fight spam on this blog, posting comments from a browser without javascript is currently not supported.