Behold the Glory of Ruby 2.1

With some of the changes in the forthcoming Ruby 2.1 (specifically garbage collection), I thought it would be interesting  to throw some (synthetic) benchmarks at it. In a couple internal benchmarks, it offered noticeable performance increases.

For a more well-known point of comparison, I turned to Mike Perham’s Sidekiq benchmark. The results were… unexpected.

MRI 2.1.0-preview1: 30 seconds
JRuby 1.7.4:
39 seconds
MRI 2.0.0-p247: 82 seconds

No, your eyes do not deceive you: Ruby 2.1.0 bested even the venerable JRuby. This outcome was so surprising that I ran the benchmark again several more times than I’d intended. The results didn’t change; 2.1.0 reproducibly came out ahead of JRuby by around 10 seconds.

While there are certainly other good reasons to go with a JVM-based interpreter, Ruby 2.1 may well turn out to be the response to many users’ performance needs—all while maintaining native extension compatibility and using the gems you know and love.