« Ruby Date Class Slows You Down? Rewrite It In C! | Main

May 01, 2009

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451c8d369e2011570643f39970b

Listed below are links to weblogs that reference The future of Rails is Ruby 1.9 - real performance of 1.8, JRuby and 1.9 compared:

Comments

Steven

Spelling error: We saw lots of syntetic[sic] benchmarks proving...

should be: We saw lots of synthetic benchmarks proving...

Alexander Dymo

Thanks, fixed

Ivar

Are your jruby benchmarks using the default or the 1.9 mode ? I'm curious because Jruby is much faster in 1.9 mode when it doesn't have to perform 1.8 backwards compatibility checks.

Also, jruby 1.3RC1 was released today, which includes yet another round of optimizations.

Delano Mandelbaum

Great! It's really interesting and somewhat refreshing to see performance numbers for a real application.

What was your test preparation process (app and db restarts/warmups)? And what was the testbed setup (separate app/db machines?, etc...)?

david

did you run jruby with --server? it's a lot faster.

these benchmark are interesting too:
http://letsgetdugg.com/2009/04/28/ruby-scaling-up-to-multiple-cpus/

Damien Diederen

Hi Alexander,

Have you had a chance to try Acunote on our CrossTwine Linker interpreters? No porting should be required (they are drop-in replacements for the Ruby versions they are based on), and they should provide further performance enhancements:

http://crosstwine.com/linker/ruby.html

I, for one, would be very happy to hear about your experience!

Charles Oliver Nutter

I'll echo others who wanted to make sure you ran with --server, and I'd like to make doubly sure you're running Java 6. In general, we should be faster than 1.9. Rails is a tricky thing to run fast, but if 1.9 does well, we should at least be able to match it. If we don't, something's broken.

If you'd like to see it run even faster on JRuby, stop by #jruby on FreeNode and we'll fix you up.

Alexander Dymo

Ivar: thanks for the 1.9 mode hint, will try. Will also try 1.3RC1.

Alexander Dymo

Delano: Our test process is this:
The app runs in the mode that closely resembles production.
For Ruby 1.8 and 1.9 we execute 1 warmup request (more isn't necessary, because we only need to warmup database and load all ruby code).
JRuby runs with JIT enabled and with JIT threshold 0. Experiments revealed that we need up to 40 warmup requests for JRuby.

Alexander Dymo

Charles: Yes, I used server VM and Java 6. The command I used to run was:
jruby -J-Xmn512m -J-Xms2048m -J-Xmx2048m -J-server -J-Djruby.compile.mode=JIT -J-Djruby.jit.threshold=0

Unfortunately, Acunote didn't run at all with jruby --fast. Also enabling some other compiler optimizations had negative effect on stability. Sometimes, after N'th repetition of the same request, the test to assert that request was ok, failed. N varied from 20 to 40.

It would be cool if we could sit together sometime at RailsConf and try to make it faster. I'm really interested to see how fast JRuby should be.

Charles Oliver Nutter

A JIT threshold of zero can often have a negative impact on performance too, but you probably tried a few options experimentally. We can try a few other things to see if we can improve performance, and perhaps see if there's any specific areas that are slower than they ought to be. As you mention, the database stuff still needs more perf work, but I'm surprised we weren't at least as fast as 1.9 for the other areas you tested. That doesn't match our experience.

We'd love to sit down and figure out how to improve perf for you.

Alexander Dymo

Damien: thanks for the hint, I've tried xtruby.
On date/time intensive requests, it was 10% faster. On rendering intensive operations it was 1-2% slower than MRI. But it couldn't finish our database intensive benchmarks - there's no error from xtruby, but our checks reported incorrect response from server.

Yehuda Katz

Any chance you could post the ported Acunote somewhere?

James

Now I would like to see you port your app to use mysql and compare mysql performance to postgres performance.

Shantanu Kumar

Do you also have information on comparative Groovy performance figures?

This is off topic I agree, but curiosity got the better of me. :-)

Roger Pack

if you re run the tests, I'd suggest running it against both 1.8 1.9 patched to have a more friendly GC:
1.8: http://blog.evanweaver.com/articles/2009/04/09/ruby-gc-tuning/
1.9: http://groups.google.com/group/ruby-benchmark-suite/browse_thread/thread/f56b4335cfd3ec57/c7babfb676d71450?lnk=gst&q=patch+gc#c7babfb676d71450

Also any you could add your benchmarks to the ruby benchmark suite? :)
-=r

Rene A.

Could you also try out the ruby enterprise edition from the mod_passeger guys? (http://www.rubyenterpriseedition.com/)

It should be a full 1.8.6 compatible ruby, but with hugh memory improvements and some performance improvements.

And since it works nicely with their mod_passenger - it would be a nice deployment combination.

Sincerly,
Rene

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Buzzletter

  • Hear about our new Ruby on Rails performance improvements, hacks, recipes, plugins & more. Enter your email below