I've been using Ruby at work recently for a quick simulation, but as expected Ruby was much slower than the C++ version I made later. After digging around I found
YARV and noticed a sizable improvement in my simulation. No longer was it orders of magnitute slower, at worse it took twice as long as the C++ version.
I couldn't get the YARV benchmark to work as listed on the homepage, running make benchmark always gave me this error:
./rbconfig.rb:7: ruby lib version (2.0.0) doesn't match executable version (1.8.2) (RuntimeError)
So I just used this command to run the benchmarks:
ruby ./benchmark/run_rite.rb --yarv-program=ruby-yarv --ruby-program=ruby
With these results
-- benchmark summary ---------------------------
app_answer 1.563 0.191
app_factorial 0.044 1.077
app_fib 22.339 2.774
app_mandelbrot 6.168 0.020
app_pentomino 283.091 81.874
app_raise 5.553 5.819
app_strconcat 4.335 4.116
app_tak 27.118 4.537
app_tarai 22.223 3.386
loop_times 11.482 5.535
loop_whileloop 29.567 3.241
loop_whileloop2 5.882 0.618
so_ackermann 1.108 3.421
so_array 18.009 5.165
so_concatenate 5.122 2.540
so_count_words 1.016 0.963
so_exception 9.109 7.160
so_lists 3.011 1.464
so_matrix 5.156 1.403
so_nested_loop 15.631 4.684
so_object 15.693 12.900
so_random 5.945 1.467
so_sieve 1.903 0.348
vm1_block 66.752 9.402
vm1_const 47.823 5.631
vm1_ensure 48.595 3.307
vm1_length 55.965 6.756
vm1_rescue 38.186 4.980
vm1_simplereturn 54.653 7.409
vm1_swap 66.258 6.440
vm2_array 17.379 7.763
vm2_method 34.623 5.980
vm2_poly_method 43.799 8.588
vm2_poly_method_ov 12.916 1.584
vm2_proc 21.020 3.922
vm2_regexp 11.758 4.923
vm2_send 13.578 4.131
vm2_super 13.536 2.628
vm2_unif1 12.153 2.194
vm2_zsuper 14.637 3.054
vm3_thread_create_join 0.110 0.364
------------------------------------------------
1074.809 243.759
ruby --version
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
ruby-yarv --version
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [powerpc-darwin8.7.0]
YARVCore 0.4.1 Rev: 519 (2006-07-12) [opts: [direct threaded code] [inline method cache] ]
uname -a
Darwin pp1 8.7.0 Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC Power Macintosh powerpc
Not to shabby if I do say so myself ;-)