Live data from Hacker News

Massive Ruby speed boost with JRuby and Java 7.

blog.jruby.org

11–20 of 79 posts

Re: Massive Ruby speed boost with JRuby and Java 7.

#11
post #3
post #2

Anyone done any comparisons between this and the official (MRI/KRI/YARV) 1.9.2 or 1.9.3?

I obviously have, but I have a lot of respect for the MRI folks and usually don't publish those results. You're free to try it out yourself. In general, JRuby should be significantly faster than MRI 1.9.2 or 1.9.3 for running Ruby code, and usually faster inside the core classes (String, Array, etc). If it's not, I consider it a bug, and encourage bug reports to that effect.

Until recently I dismissed JRuby, but then I needed to run some stress testing code against an Oracle DB. With MRI Ruby and the OCI8 library, the Ruby overhead stopped me being able to push the database hard enough. I switched to JRuby and JDBC and the results were amazing, so I am converted. The only niggle I have is the startup overhead, which I know is a JVM thing. Not a problem for my benchmarking, but a little bit of an annoyance for a command line ruby tool I use.

As an aside, I did run across a bug, not performance related, but a case around popen where JRuby doesn't behave the same as MRI - I raised a ticket (JRUBY-6225) but it doesn't seem to be getting any traction. I understand there are probably plenty of tickets to be prioritized, but this one is a bit of a show stopper for me. If anyone from the JRuby team is see this and has time to have a look at it I would be grateful.

Re: Massive Ruby speed boost with JRuby and Java 7.

#12
post #5

I just update to java7 in ubuntu 11.04 then using sudo update-java-alternatives there is an error: no alternatives for -javaplugin.so

Your updated Java 7 is probably a 64-bit version. There's currently no Java applet browser plugin for 64-bit (and I'm not sure if there's plans to create one). If you don't mind missing out on Java applets, you'll be fine.

A silly question: Can I call jruby or jirb with something like classpath?

I don't want to lose my java applet for firefox,(ubuntu 11.04 64 bits,four-cores).

I would also like to see some comparison, for example like in the computer benchmark game between jruby and other ruby implementations.

What about clojure and scala? will they get a speed up with the new java 7 update? , Will it be three-fold like jruby (in certain cases?). Thanks for the great work on jruby. Being more dynamic is great!

Re: Massive Ruby speed boost with JRuby and Java 7.

#13
post #11
post #3

Earlier quoted context omitted.

I obviously have, but I have a lot of respect for the MRI folks and usually don't publish those results. You're free to try it out yourself. In general, JRuby should be significantly faster than MRI 1.9.2 or 1.9.3 for running Ruby code, and usually faster inside the core classes (String, Array, etc). If it's not, I consider it a bug, and encourage bug reports to that effect.

Until recently I dismissed JRuby, but then I needed to run some stress testing code against an Oracle DB. With MRI Ruby and the OCI8 library, the Ruby overhead stopped me being able to push the database hard enough. I switched to JRuby and JDBC and the results were amazing, so I am converted. The only niggle I have is the startup overhead, which I know is a JVM thing. Not a problem for my benchmarking, but a little b…

Recently we've been working more on JRuby master, on new features and performance. With JRuby 1.6.6 coming soon and 1.7 starting to stabilize, we'll be circling back to these bugs.

Of course, we can always use help too :)

Re: Massive Ruby speed boost with JRuby and Java 7.

#14
post #5

Earlier quoted context omitted.

Your updated Java 7 is probably a 64-bit version. There's currently no Java applet browser plugin for 64-bit (and I'm not sure if there's plans to create one). If you don't mind missing out on Java applets, you'll be fine.

A silly question: Can I call jruby or jirb with something like classpath? I don't want to lose my java applet for firefox,(ubuntu 11.04 64 bits,four-cores). I would also like to see some comparison, for example like in the computer benchmark game between jruby and other ruby implementations. What about clojure and scala? will they get a speed up with the new java 7 update? , Will it be three-fold like jruby (in certa…

You can certainly just call JRuby directly with the 'java' command, or just set your environment to point at the Java 7 install only when you need it, rather than forcing your whole environment to use Java 7 by default.

I imagine the computer benchmarks game will update when we have a release of JRuby 1.7 out, sometime early 2012. If someone else wants to do some benchmark runs, I have no objection.

As for Clojure and Scala...they may see modest improvements from Java 7, but neither of them use invokedynamic at all. The biggest boost for JRuby comes from invokedynamic.

Re: Massive Ruby speed boost with JRuby and Java 7.

#15
post #2

Anyone done any comparisons between this and the official (MRI/KRI/YARV) 1.9.2 or 1.9.3?

a) There will be problems in the Computer Language Benchmark. Like with the excellent LuaJit, they only allow one version of a language, so a war of implementations to appear would not be surprising.

b) Now that Python is in a difficult transition to Python 3, a strong ruby is a game changing point. Antonio Cangiano `New Relic Holy Shmoly, Ruby 1.9 smokes Python away!` could be Jruby smokes Python away :) (if there is a two-fold increase in speed I expect A. Cangiano article rewrited)

c) What about duby and groovye?

Re: Massive Ruby speed boost with JRuby and Java 7.

#17
post #13
post #11

Earlier quoted context omitted.

Until recently I dismissed JRuby, but then I needed to run some stress testing code against an Oracle DB. With MRI Ruby and the OCI8 library, the Ruby overhead stopped me being able to push the database hard enough. I switched to JRuby and JDBC and the results were amazing, so I am converted. The only niggle I have is the startup overhead, which I know is a JVM thing. Not a problem for my benchmarking, but a little b…

Recently we've been working more on JRuby master, on new features and performance. With JRuby 1.6.6 coming soon and 1.7 starting to stabilize, we'll be circling back to these bugs. Of course, we can always use help too :)

I'd love to help, but my Java skills are almost none existent! If I thought I could make any headway into that bug I'd jump in - maybe over the holidays I will try and have a look.

Re: Massive Ruby speed boost with JRuby and Java 7.

#18
post #5

Earlier quoted context omitted.

Your updated Java 7 is probably a 64-bit version. There's currently no Java applet browser plugin for 64-bit (and I'm not sure if there's plans to create one). If you don't mind missing out on Java applets, you'll be fine.

A silly question: Can I call jruby or jirb with something like classpath? I don't want to lose my java applet for firefox,(ubuntu 11.04 64 bits,four-cores). I would also like to see some comparison, for example like in the computer benchmark game between jruby and other ruby implementations. What about clojure and scala? will they get a speed up with the new java 7 update? , Will it be three-fold like jruby (in certa…

   $ man update-java-alternatives 
  
  --jre  
    Limit the actions to alternatives belong to a  runtime  environment, not a development kit.
  --jre-headless  
    Limit the actions to alternatives belong to the headless part of a runtime environment.
  --plugin
    Limit the actions to alternatives providing browser plugins.

Re: Massive Ruby speed boost with JRuby and Java 7.

#20

10-30% faster is “massive”? Ruby standard is 5-30 times slower than all other popular language implementations, I'd expect at least a 100% increase to be considered “massive.” I'd call this just “a speed boost.” Anyway, keep it up.

A quick look at the programming language shootout (http://shootout.alioth.debian.org/) puts Ruby in roughly the same performance league as Python and Perl, and you'd be hard-put to argue that these aren't popular languages.
Post reply on HN