2012/6/29 Hans Mackowiak <lists / ruby-forum.com>:
> Bartosz Dziewoski wrote in post #1066673:
>> The MRI is, unfortunately, slow as balls, and there's not much you can
>> do. For computation-intensive tasks try JRuby or, well, a different
>> programmming language.
>>
>> -- Matma Rex
>
> if you write shitty code, its still shit in jruby too.
> MRI 1.9 is faster then 1.8.

Yes, of course 1.9 is faster.

Still. Benchmark this for me, would you:

    1_000_000_000.times{|a| }

It takes 103 seconds to run on my machine. The following code in C++,
compiled with -O0, takes four seconds.

int main()
{
	for(int i=0; i<1000000000; i++){};
	return 0;
}

(I have verified that the generated assemly code actually runs the loop.)

MRI Ruby *is* two orders of magnitude slower than C and often
noticeably slower than other interpreted languages and no matter how
much you love it, you can't deny it's slow.


-- Matma Rex