Playing with JRuby, Part 1A
Posted: February 18th, 2009 | Author: Brad | Filed under: Programming | Tags: jruby, performance, ruby | Comments OffFirst, thanks to Lopex, Charles/Headius, and Thomas for their well-coordinated effort to alleviate some of my JRuby ignorance in my earlier post. And for not going out of their way to make fun of my janky “benchmarks” – like I said, those weren’t meant to be real benchmarks, just something to give me an idea of relative performance with some operations I care about.
In that same spirit, I took Lopex’s advice and turned on the –server flag; performance gain went from almost 2-to-1 to almost 3-to-1, with no other changes or optimizations.
Before:
[~/project/jrubytest/primes]> ruby ./primes.rb FINDING first 100000 PRIMES 1299709 Time: 57.716853s [~/project/jrubytest/primes]> jruby ./primes.rb FINDING first 100000 PRIMES 1299709 Time: 33.885273s
After:
[~/project/jrubytest/primes]> ruby primes.rb FINDING first 100000 PRIMES 1299709 Time: 57.204178s [~/project/jrubytest/primes]> jruby --server primes.rb FINDING first 100000 PRIMES 1299709 Time: 21.067204s
Thanks to the JRuby crew for stopping by here, and for being so helpful generally.