kidoman / rays

Ray tracing based language benchmarks
https://kidoman.com/programming/go-getter.html
95 stars 23 forks source link

Add Ruby port #10

Closed zaeleus closed 10 years ago

zaeleus commented 10 years ago

I ported the original C++ implementation (with some reference to the Go implementation) to Ruby. I have not fully profiled the code to check if it's optimal.

The implementation is multithreaded, but unfortunately, MRI's GIL does not allow for thread-level parallelism. It is recommended to run on either [Rubinius][2] or [JRuby][3], which is an alternative Ruby implentation that does support real threading.

It is... not fast. :)


Single run benchmarks (AMD FX-8350 @ 4.40GHz; 768x768; 8 threads)

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
  10228.12s user 3.88s system 100% cpu 2:50:27.91 total

rubinius 2.0.0 (2.1.0  2013-10-04 JI) [x86_64-linux-gnu]
  10694.84s user 103.45s system 658% cpu 27:19.82 total

jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK 64-Bit Server VM 1.7.0_40-b60 +indy [linux-amd64]
  7857.97s user 77.92s system 694% cpu 19:02.48 total

Updated 2013-10-06.

kidoman commented 10 years ago

Awesome stuff :+1:

kidoman commented 10 years ago

Good thing to test on Rubinius 2.0, now that it is released