Live data from Hacker News

Massive Ruby speed boost with JRuby and Java 7.

blog.jruby.org

41–50 of 79 posts

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

#41
post #38
post #37

Earlier quoted context omitted.

That is truly bizarre. There's probably mirrors of the JRuby downloads somewhere, eh? I don't know them offhand...

I tried to find one but I ended up "cheating". If you try and send from a gmail account it will fail but gmail will keep the file on its servers. So I can log into gmail at work, and download the binary from the failed sent message. sigh

Cute :)

In other news, I realized our "org.jruby:jruby-dist" maven artifact hasn't been publishing a full dist tarball, like it's supposed to, so we'll get that fixed.

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

#42
post #36
post #35

Earlier quoted context omitted.

Is this the case for Java 7? It's not the case for Java 6. There is one from Oracle, which I'm using. $ file .mozilla/plugins/libnpjp2.so .mozilla/plugins/libnpjp2.so: symbolic link to `/usr/local/lib/jvm/jre1.6.0_29/lib/amd64/libnpjp2.so' There's one from OpenJDK as well. $ apt-cache show icedtea-plugin Package: icedtea-plugin Source: icedtea-web Version: 1.1.4-1 Installed-Size: 276 Maintainer: OpenJDK Team Architec…

Perhaps IcedTea (RedHat's fork of OpenJDK) has included a 64-bit plugin. I did not think OpenJDK/OracleJDK had done so yet...but I'd love to be proven wrong.

Like I said, libnpjp2.so is a 64-bit plugin from Sun/Oracle. It's been available from Sun since Java 1.6.0_12 in 2008. It's still available in Java 1.6.0_29; I just downloaded and installed it from Oracle last week. I have not looked into support for Java 7 or operating systems besides linux.

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

#43
post #28
post #23

Earlier quoted context omitted.

I'm a big fan of JRuby for two notable reasons. First, JRuby runs on the JVM, which is arguably the most mature and tested VM on the market today; second, you can leverage both the Ruby and Java ecosystems without any additional overhead (the Java interop is almost seamless). Being able to write classes in Java (or Mirah) where speed is crucial, and use them from within JRuby without having to do any additional work,…

I believe Rails can also run on the JVM via JRuby. I wonder what the benchmark is between Rails/JVM and Grails 2.0 ???

Rails 2 and Rails 3 run beautifully on JRuby.

Github:FI (the locally-installed version of Github) was, for instance, a JRuby application.

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

#44
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 i…

I wonder how long until the JRuby vs PyPy "benchmarks" start appearing.

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

#45
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…

There seem to be a few bug reports all around the same phenomenon. See also JRUBY-6162. I started digging into it a bit last week, but I was in the middle of a release and didn't have time to get very far. My working hypothesis is that the external process is getting killed off by JRuby before it has time to finish executing. The (hacky) workaround is to make your code wait a bit so the process has time to complete.…

6162 does sound very like my issue. I must try sticking a sleep inside the block passed to popen and see if that gets past my problem. It's not a solution as such, as the process I am calling could take anywhere from a second to many minutes to execute, but it will be interesting to try. If you manage to solve these bugs it will be a great help to me, so good luck!

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

#46
post #2

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

"Compared to JRuby on Java 6, JRuby on Java 7 without invokedynamic is around 25% faster, and JRuby with invokedynamic is nearly 3 times faster."

JRuby already is as fast or faster than MRI, and a 3X increase in performance is absolutely huge.

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

#47
post #30

Earlier quoted context omitted.

Why would respect for the MRI devs stop you from publishing benchmarks? It's not an insult to say that something else is faster. I'd imagine the competition might drive them to improve if at all possible.

I feel like the MRI devs get beat on a bit too much, and they're doing the best job possible with very few paid developers. I'm more interested in showing how JRuby is improving over time than rubbing salt in the wounds.

Speaking of very few paid MRI developers, does anyone know if the Ruby project takes donations to hire full-time paid developers? If yes, could you please point us to the donations page?

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

#48
post #2

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

On my computer Linux 3.0.0-15-generic #24-Ubuntu SMP Mon Dec 12 15:23:55 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux RAM=6G "Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz"

A simple comparison using binary-tree (from computer language benchmark) between ruby1.9.1 and jruby show that on my machine jruby time is half of 1.9.1

~/lang/ruby/jruby-1.6.5/bin$ time ./jruby --server -J-Xmx2000m algo.rb 18 gives real 0m32.447s user 0m38.478s sys 0m0.904s

time ruby1.9.1 algo.rb 18 real 1m11.388s user 1m11.192s sys 0m0.148s

./jruby --server -J-Xmx2000m -v jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (OpenJDK 64-Bit Server VM 1.7.0_147-icedtea) [linux-amd64-java]

the algo.rb file is the version contributed by # contributed by Jesse Millikan # Modified by Wesley Moxam and Michael Klaus

this is n=18, for n=16,17 ... results are similar. Half the computing time.

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

#49
post #33
post #30

Earlier quoted context omitted.

I feel like the MRI devs get beat on a bit too much, and they're doing the best job possible with very few paid developers. I'm more interested in showing how JRuby is improving over time than rubbing salt in the wounds.

Great attitude.

Really glad that @headius is getting some recognition for his dogged work in this space. I know he's been up against a sometimes quite hostile Ruby crowd but has remained a gentleman throughout.
Post reply on HN