I have a Rails 3.2.2 application that I am looking to run using JRuby 1.6.7 (1.9.2 mode).
I have a sample app running in MRI ruby 1.9.3 and a typical request is returning in ~40ms: Completed 200 OK in 36ms (Views: 27.5ms | ActiveRecord: 8.2ms)
Under JRuby using the same request is anywhere from 3 to 20 times slower depending on the page. For the same operation as above it takes ~180ms: Completed 200 OK in 180ms (Views: 153.0ms | ActiveRecord: 24.0ms)
Is this a normal performance difference? I have read that JRuby is roughly equal on speed with MRI. The results hold on my Mac and a Windows server (where unfortunately it will need to run). Packaging it up with Warbler running under Tomcat is just as slow.
The above times are from a basic rails app created for testing the JRuby. On the more complex app the times are even farther apart. On that app there is more ruby code being run on some pages. It seems that the more the page is ruby dependent the greater the performance difference I am observing. I have done no tuning of JRuby, since I don't know quite where to start.
So my questions are: is this normal? What can I do to tune JRuby?
production
mode, compared to the development mode brings sometimes 5-6 times faster response. At least that was in my case. Thanks for noting that. – Fingertip