tags:

views:

66

answers:

2

Having been landed with a Ruby project, I have been sceptical about the decision to use Ruby due to performance.

I was excited to discover JRuby with its Java integration. This has made the project massively easier for me. And now I have just been totally tickled even more to discover that JRuby can be compiled down to Java bytecode .

With benchmark figures like so :

fib(30) Ruby: 1.67s

fib(30) JRuby interp (client VM): 3.93s

fib(30) JRuby interp (server VM): 2.28s to 2.08s

fib(30) JRuby compiled (client VM): 1.89s to 1.79s

fib(30) JRuby compiled (server VM): 1.66s to 0.86s

I am now getting very excited about our choice of JRuby here. Is there any disadvantages or reasons why you would not compile for the production release?

A: 

Ruby is very fast to develop in (if you are familiar with it's style).

Its not so fast to run, but this is not usually a big minus. Its plenty fast enough for most workloads, even large websites.

The decision ought not be based upon runtime speed - unless you have stats to say people are expected to be unhappy with performance - but rather ease of deployment.

If the deployment of Ruby applications has been achieved by your predecessors, then keep it Ruby.

If deploying to JVM is easier, go with that.

Will
We have already decided on jruby. I am asking about compiled vs interpreted jruby!
Mongus Pong
+1  A: 

The distribution and installations would make that decision easier for me: as a sysadmin, I'd much rather distribute just a .JAR file that can run on many JRE's than have to distribute a working JRuby instance (which is different for different OSes, for example) and my source code. Plus, you have already demonstrated that AOT-compiled code is faster than the interpreted/JIT, so all the more reason to distribute the compiled version.

ewall