A Ruby newbie posted to Ruby Lang that he had implemented an is_prime? algorythm in Ruby, Perl, and Java with results:
- Ruby result: 101 seconds
- Java result: 9.8 seconds
- Perl result: 62 seconds
Ruby lang is a great community, and over time they broke down the code and got all of the versions to fractions of these numbers.
It again really showed:
- How micro-benchmarks are a scary beast
- The choice of the algorythm here made the biggest difference (good ‘old Big O). The right choice with Ruby was magnitudes faster than the wrong choice in C.
- The power of CPAN and company, where everything you ever need is already done
- Inline C. Mmm :/
- FAST ENOUGH IS FAST ENOUGH
That being said, having Ruby grow up from the world of the interpreter would be very cool (YARV etc etc).