kid0m4n/rays — pull request #10 by zaeleus (2013-10-06 07:15:31+00:00)
Title: Add Ruby port

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.

This implementation is multithreaded, but MRI's GIL does not allow for thread-level parallelism. I recommend running it on either Rubinius or JRuby, which are alternate Ruby implementations that do support real threading.

It is... not fast. :)

---

Benchmarks (Intel Core i7-2635QM @ 2.00GHz; 8 threads; in seconds)

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
2212.53 real 2210.04 user 2.76 sys

rubinius 2.0.0 (2.1.0 2013-10-04 JI) [x86_64-darwin12.5.0]
264.58 real 1609.44 user 58.09 sys

jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_17-b02 [darwin-x86_64]
319.39 real 2381.19 user 10.40 sys

jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_17-b02 +indy [darwin-x86_64]
188.91 real 1385.42 user 8.23 sys