From: Charles Oliver Nutter Date: 2012-02-15T17:57:02+09:00 Subject: Re: Basic Ruby performance On Fri, Feb 3, 2012 at 12:56 PM, Dmitry Nikiforov wrote: > jruby is just as slow as regular ruby 1.9.3. I cannot reproduce. Post your jruby -v...I suspect it's running with the non-optimizing JVM mode. This is JRuby master + Java 7, which is the fastest of all Ruby impls I have installed: system ~/projects/jruby $ jruby -rbenchmark -e "3.times { puts Benchmark.measure { for a in 0..1E8; a * 2; end } }" 8.945000 0.000000 8.945000 ( 8.945000) 8.405000 0.000000 8.405000 ( 8.405000) 8.341000 0.000000 8.341000 ( 8.341000) system ~/projects/jruby $ rvm 1.9.3 do ruby -rbenchmark -e "3.times { puts Benchmark.measure { for a in 0..1E8; a * 2; end } }" 17.540000 0.000000 17.540000 ( 17.552517) 17.440000 0.010000 17.450000 ( 17.440687) 17.490000 0.000000 17.490000 ( 17.498955) system ~/projects/jruby $ macruby -rbenchmark -e "3.times { puts Benchmark.measure { for a in 0..1E8; a * 2; end } }" 15.800000 0.010000 15.810000 ( 15.803463) 15.750000 0.000000 15.750000 ( 15.751863) 15.850000 0.000000 15.850000 ( 15.860579) system ~/projects/jruby $ ../rubinius/bin/rbx -rbenchmark -e "3.times { puts Benchmark.measure { for a in 0..1E8; a * 2; end } }" 11.190136 0.002077 11.192213 ( 11.193023) 11.087971 0.003063 11.091034 ( 11.091239) 7.020758 0.001578 7.022336 ( 7.022235) It's a pretty meaningless benchmark, though. - Charlie