views:

212

answers:

5

I'm interested in promoting JRuby in our office as the platform hosting Rails applications.

But how reliable is it?

Is its performance better than MRI 1.8.7?

JRuby 1.5 states that it is 100% compatible with Ruby 1.8.7, does this mean that JRuby can run any Ruby/Rails code?

+4  A: 

Yes, JRuby is reliable! Oracle uses JRuby for Oracle mix (http://mix.oracle.com/), Sun had used it for Kenai (http://kenai.com), and it's gonna be the next base for java.net (from kenai site: "Work is on-going for migrating the Java.net domain over to the Kenai infrastructure")!!

You can run almost every code, some gems uses native C extension and in JRuby there's a primitive support to it, but yes...rails just works.

You can deploy Rails apps in Application Servers like Tomcat or JBoss with Warbler that wraps Rails apps inside a .war file, it's pretty awesome!

update: you can see a lot of benchmarks here: http://programmingzen.com/2010/07/19/the-great-ruby-shootout-july-2010/

Luke
+1  A: 

JRuby rocks!! The simple reason being its portability features and integration with Java libraries. I personally use it with Netbeans and the fast debugger that comes with that seems very handly. Plus you do not want to see that native build errors and handling them. All these gems that you download for JRuby work 100% across any platform. With JRuby, you are simply bringing in the advantages of the Java's Platform independence.

Moreover, JRuby uses native threading which uses OS threads instead of Green threads as in CRuby (i think its not the case with the latest versions though)

In Gist, go JRuby!!

Bragboy
+1  A: 

I am doing a lot of jruby work right now and can tell you that rails is certainly a viable option under the jruby interpreter. I've been pretty pleased and in my case have to use many native Java libraries, so jRuby is just such an awesome wrapper around that java code. I will say that I have had some technical challenges some that are worked out, some that are not yet.

  1. unit testing: spooling up the jvm and then spooling up rails takes much longer, so your tests take longer to run - solution, potentially something like nailgun that keeps the jvm running
  2. deployment: i have not gotten warbler to work for me, with my flavor of tomcat. this is a major issue for us.
  3. pick your libraries, while some c extensions work, they are not all equally compatible.

if you are interested I would highly reccomend the jruby book, in beta, from Pragmantic Programmers at http://pragprog.com

Jed Schneider
Would you please tell me about JRuby performance?
El Gusto
once the JVM is spooled up, the performance is roughly equal to 1.9.1 http://www.rubyinside.com/jruby-1-5-0-released-the-best-alternative-ruby-implementation-gets-even-better-3252.htmlwith potentially more speed by tweaking the compiler: http://kenai.com/projects/jruby/pages/PerformanceTuningbut you can always benchmark your own systems and needs with rvmhttp://rvm.beginrescueend.com/set/benchmark/
Jed Schneider
One annoying thing about Grails that it takes a lot of time to launch (wether running a server, generating controllers and models, running tests).Does JRuby suffer the same issue?
El Gusto
yes - which is what I am referring to as 'spooling the JVM' in #1 list item in my answer. the problem is not grails or jruby, but having to load up the java virtual machine. there are solutions though, see nailgun: http://martiansoftware.com/nailgun/index.html
Jed Schneider
you can use spork for unit testing to speed things up (and nailgun) http://github.com/rdp/spork
rogerdpack
A: 

for windows I have found it to be much more stable than MRI when working with larger amounts of data. There are some bugs on windows still but they are actually work-around-able. Recommend.

rogerdpack
A: 

Disclaimer: I don't use jruby in my day job - I merely experimented with running existing code using jruby.

It doesn't mean that it'll run all code successfully. For example, bioruby currently calls fork on jruby even though jruby doesn't really support it. (That's more of a bug in bioruby than a bug in jruby though)

I wouldn't call such behaviour "unreliable" though. It's fail-safe, like a plane that would not get off the ground, much less crash.

Andrew Grimm