On Fri, Oct 30, 2009 at 10:14 AM, James M. Lawrence
<quixoticsycophant / gmail.com> wrote:
> == ruby 1.9.2dev (2009-10-18 trunk 25393) [i386-darwin9.8.0]
> Rehearsal -------------------------------------------------------------
> 1 thread, 1 interpreter   4.370000  0.020000  4.390000 ( 4.389990)
> 2 threads, 1 interpreter  4.360000  0.030000  4.390000 ( 4.385111)
> 2 threads, 2 interpreters  0.010000  0.010000  4.700000C2.460661)
> --------------------------------------------------- total: 13.480000sec
>
>                user   system   total    real
> 1 thread, 1 interpreter   4.360000  0.020000  4.380000 ( 4.376050)
> 2 threads, 1 interpreter  4.360000  0.030000  4.390000 ( 4.380982)
> 2 threads, 2 interpreters  0.010000  0.010000  4.710000C2.465925)
>
>
> == jruby 1.4.0RC3 (ruby 1.8.7 patchlevel 174) (2009-10-30 1d7de2d) (Java
> HotSpot(TM) Client VM 1.5.0_20) [i386-java]
> Rehearsal ------------------------------------------------------------
> 1 thread, 1 interpreter  6.060000  0.000000  6.060000 ( 6.060000)
> 2 threads, 1 interpreter  7.629000  0.000000  7.629000 ( 7.629000)
> -------------------------------------------------- total: 13.689000sec
>
>                user   system   total    real
> 1 thread, 1 interpreter  6.080000  0.000000  6.080000 ( 6.080000)
> 2 threads, 1 interpreter  7.288000  0.000000  7.288000 ( 7.288000)

JRuby benchmarking:

* Use Java 6+

Java 6 is much faster than Java 5. Java 7 is faster still in many cases.

* Pass --server if -v output says "client" VM

The Hotspot JVM has two modes: "server" and "client". The "server" VM
does runtime-profiled optimizations and can be 2x or more faster than
the "client" VM.

Results on my system (core 2 duo 2.66GHz):

ruby 1.9.2dev (2009-07-23 trunk 24248) [i386-darwin9.7.1]
Rehearsal -------------------------------------------------------------
1 thread, 1 interpreter     3.370000   0.020000   3.390000 (  3.516261)
2 threads, 1 interpreter    3.330000   0.020000   3.350000 (  3.412460)
2 threads, 2 interpreters   0.010000   0.000000   3.590000 (  2.133313)
--------------------------------------------------- total: 10.330000sec

                                user     system      total        real
1 thread, 1 interpreter     3.350000   0.010000   3.360000 (  3.415410)
2 threads, 1 interpreter    3.350000   0.020000   3.370000 (  3.423560)
2 threads, 2 interpreters   0.000000   0.010000   3.630000 (  2.302965)

jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2009-10-30 eaa9e7f) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
Rehearsal ------------------------------------------------------------
1 thread, 1 interpreter    2.373000   0.000000   2.373000 (  2.373000)
2 threads, 1 interpreter   1.733000   0.000000   1.733000 (  1.733000)
--------------------------------------------------- total: 4.106000sec

                               user     system      total        real
1 thread, 1 interpreter    2.145000   0.000000   2.145000 (  2.145000)
2 threads, 1 interpreter   1.840000   0.000000   1.840000 (  1.840000)

It would probably improve more with a longer run, but this is pretty good.

- Charlie