See my blog post regarding this code at: http://danlynn.org/home/2012/1/15/ruby-optimized-using-inline-c-and-java.html A while back, for the pure joy of programming ...