On Feb 2, 2012, at 8:19 PM, Dmitry Nikiforov wrote:

> Jeremy Bopp wrote in post #1043805:
> 
>> (0..1E7).each do
>>  s =~ / test /
>> end
> 
> Hmmm... Didn't realize this would make difference :) Thanks!
> 
>> Don't get hung up on micro benchmarks like the above though!  They can
>> really be deceiving with respect to real world applications.
> 
> Well, I started doing these benchmarks after I've tried to rewrite parts 
> of the project I'm working on in Ruby. The project is rather 
> complicated, so it seemed as if Ruby's neat, clean syntax would make it 
> easier to handle, but the performance was dreadful. Initially I tried 
> 1.8.7 that came natively with OS X Lion, then installed 1.9.3, without 
> much difference in performance - it's still mostly multiple times slower 
> than the Perl version I have :( The problem with Perl version, though, 
> is that once it reaches certain limit - it becomes rather hard to manage 
> (especially so if you focus on performance the most - there are tricks 
> in Perl that make code run significantly faster, but make it virtually 
> unreadable).

Hard to believe that this thread has gone this long without a mention of other Ruby runtimes.

You may want to also benchmark with JRuby (jruby.org) or with Rubinius (rubini.us). For ease of installation, you may want to consider using "rvm" to manage your Rubies (google for it to figure out how to install it).

cr