Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Rails 1.2 slower than 1.1?

Rails 1.2 slower than 1.1?

Stefan Kaes, a Rails core developer since 2005, and author of InfoQ's 2006 most viewed article on Rails Performance,  has released Railsbench 0.9.2. Railsbench is a collection of ruby and shell scripts which make measuring raw performance of rails apps a snap. Benchmarking of HTTP POST requests is now supported and several other features have been added that affect the specification of the Railsbench benchmarks.yml configuration file, and the generation of PNG graphics.

Stefan put the new version into practice by comparing Rails 1.1-stable and 1.2-stable with a test suite made of simple rendering, action cached and session creation. The suites were run with different session options using pstore, ActiveRecordStore and SqlSessionStore.

From those tests, Stefan found out that 1.2-stable was about 20% slower than version 1.1.   The full report comes with remarks and advise:
  • Previous reports on Rails 1.2 being twice as slow as Rails 1.1 are performance FUD
  • Action caching could use some attention
  • Never use pstore as your session container
  • With the current Ruby interpreter it seems impossible to avoid slowdowns as the code base of Rails grows, due to slow GC and large interpreter overhead. YARV might change this.
The question perhaps remains: Did the Rails core team sacrifice performance for features on Rails 1.2? Will there be focus on performance for the next stable release?

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Unsubstantiated Claims...

    by Sam Smoot,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Rails creates a lot of objects it doesn't need to. It seems that the language and GC is catching some of the flak for this undeservedly.

  • If 1.1 was good enough for you...

    by Michael Neale,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    then 1.2 will be just fine. Just use it, the features are probably worth it.

  • Ruby and concurrency

    by Scott Fraser,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    It appears that these benchmarks are a single threaded client, is that correct? In other words when the test was "run 5000 times", it was 5000 serial calls to the web server. As opposed to 5000/X calls made by X number of clients all at the same time.

    I am curious about how Ruby performs under a multi-threaded load - can anyone comment?


    Scott Fraser

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p