Comparison of Nine Ruby Implementations
An anonymous reader writes "Zen and the Art of Programming published a new version of The Great Ruby Shootout, which was aimed at testing the performances of multiple Ruby implementations. On the benchmark table this time around are Ruby 1.8 (on GNU/Linux and Windows), Ruby 1.9 (aka Yarv), Ruby Enterprise Edition (aka REE), JRuby 1.1.6RC1, Rubinius, MagLev, MacRuby 0.3 and IronRuby. The results of this comprehensive comparison show that for this set of benchmarks, Ruby 1.9.1 is almost 5 times faster than the notoriously slow Ruby 1.8. Is Ruby finally going to be acceptably fast?"
Ruby 1.9.1 and JRuby seem to be the 'winners' in most tests. Have a look at the PNG here: http://antoniocangiano.com/images/shootout3/main_time.png
I've heard a lot of good things about the JRuby project, and this test seems to demonstrate that it's probably the closest in terms of speed to the standard Ruby (canonical Ruby?)
creation science book
Is there a reason why they did not test Cardinal, the Ruby implementation for Parrot? I know it is not production-ready yet but it would be interesting to see how performance compares.
-- Ed Avis ed@membled.com
That's the worst cockney accent I've ever heard in my life.
Look at how many 0.002 and similar instantaneous results there are. Tests were run 5 times and the best result used, so there probably wasn't even a single garbage collect that happened in many of the tests. You can't really say from such short benchmarks, but those tests probably did not include Java's strength of hotspot optimization over time.
There were a couple tests that were much slower in JRuby, but this is countered by the test that failed on Ruby 1.9.1; fast means nothing when you don't finish.
I heard Rich Kilmer talk about the various Ruby implementations once; his take on them were that each would be used to leverage the underlying platform. In other words, if you want to use Java libraries, you'll use JRuby. If you want to use the Mac libraries (e.g., via Hot Cocoa), you'll use MacRuby. And if you want to use C extensions like RMagick and libxml2, you'll use MRI.
I thought that was an interesting way of looking at the various implementations... each one would be appropriate for a different scenario.
The Army reading list
> Is Ruby finally going to be acceptably fast?
Ruby has always been acceptably fast for most values of acceptably.
In cases where it has not been acceptable, it probably will continue not to be since those are cases where better performance is always welcomed (large volume web services).
You should buy a screen reader with cockney support then, mate. Personally, I use the CockneyCobblers3000 Deluxe, it even has support for rhyming slang:
Comes out, read like this, as:
What does acceptably fast really mean? If I can write code 5x as quickly relative to Java or C, Ruby will always be fast enough for me. Humans are expensive, CPU cycles are cheap.
It is a bit annoying that Python 3.0 is about 10% slower than 2.6.
I've heard some sensationalist claims that Ruby 1.9.1 is now significantly faster than Python, but of course they always turn out to be some simple test like tail recursion. At the same time, I've seen some awful performance numbers from things like Rails compared to Django.
Anyone have a rough idea of the performance comparison between the two and what bottlenecks people are likely to hit on either side? I know the GIL in Python is sometimes blamed for a lot of problems...
I have great hopes in the YARV to LLVM compiler (yarv2llvm), even if you can't read japanese, have a look at the numbers: http://d.hatena.ne.jp/miura1729/20081012/1223785541
{{.sig}}
"high level" enough is a relative term. For me, PHP is not enough unless you put it together with one of the MVC frameworks like CakePHP or Symfony. In any case, there are a ton of people (including myself) who like Ruby better for a variety of reasons and we don't have problems with it being too slow (though faster speed is always a welcome improvement). Point is: if you want to use PHP, do it. I don't really care to "persuade" you otherwise. But it's always annoying to see such comparison on a thread like this 'cause this thread has nothing to do with PHP and no one really cares if you like it better :-)
I don't get all this fascination with ruby, and why it currently seems to be so fashionable that people are willing to take perfectly good projects and rewrite them in this new fashionable language...
Take for example metasploit (see metasploit.com), version 2.x was written in perl and was reasonably quick, version 3 is a complete rewrite in ruby and it's now orders of magnitude slower and more memory hungry than the perl version ever was... Trying to script the CLI based version is now pretty much useless because of how long it takes to initialize, even considering that the hardware in use is a couple of years newer and much faster.
Inefficiency like this is a bad thing, people complain about microsoft bloat, and yet they champion a language which produces code a fraction of the speed of any alternatives... They talk about how 1.9 is 5x faster than 1.8, and is still ridiculously slow compared to anything else?
You think Vista is bloated and slow? imagine if they wrote it in ruby...
http://spamdecoy.net - free throwaway anonymous email - avoid spam!
for large web apps, using higher tools is BAD.
you will get innumerable scaling/modification/adaptation issues in future.
Read radical news here
its about which technology is better.
because, even if we like it or not, we are being pushed stuff that are a pain to work with or problematic for the future, just because of the hype the '2.0' and similar crowds generate. and they are being herded by sources that want to sell certificates, books and make money.
it affects our lives. sooner or later some supervisor or client of yours is gonna shove some hyped tech up your butt, demanding you do stuff with it.
and no, its not about 'bettering yourself' or catching up with technology.
some stuff, are bad.
you'll want example at this point, here, have twitter.
Read radical news here
faster to build.
Read radical news here
Yeah i agree there...
Lots of people seem to be converting existing projects to ruby because "it's the in thing", without bringing any practical benefit to the project, but at the same time replacing perfectly good code with new untested code which runs much slower and consumes more resources...
Compare the performance of metasploit 2 to metasploit 3 for a good example.
http://spamdecoy.net - free throwaway anonymous email - avoid spam!
Ruby is not really a serious programming language to be used in mission critical projects. It is an excellent resource for teaching development best practice due to the patterns it enforces but this comes at a cost. That cost is inflexibility. It frequently restricts thing that are on the borderlines of acceptable practice but in certain very specific circumstances are the best way of achieving a given end.
The only immediate example I can think of in my lunch break is it rigorous enforcement of best practice in database design. The real world is not perfect, sometimes you have to write code that interfaces with truly awful database design to get at legacy data, in this instance forget Ruby. If you are going to have to avoid a platform for certain jobs why use it at all?
Don't get me wrong, I think everyone should learn Ruby in the same way that everyone should learn Pascal. Pascal on the other hand cannot hold a candle to C or C++ in terms of professional development projects due to the flexibility it offers.
Quite frequently in the real world commercial pressures force an interim solution that Ruby cannot hope to offer for the reasons above. You might say that it is better to perform a complete rewrite in these situations but sometimes this is simply not possible due to the number of man hours available for a particular project.
We looked at converting our system to Ruby a few years ago but we simply did not have the developers to perform a complete rewrite in the time available. We could not afford to put all paying work on hold for the 9 months it would have taken our entire development team. In the end we chose PHP as this have us the flexibility we needed while allowing us to migrate the most important parts first but still use the old code for the rarely used pages until we need to modify them. While having the two systems side by side would be possible it would not be practical to get Ruby to pull data from an archaic awful database design that the old required.
Now some people say that Ruby is still perfect for new systems that will never be effected by these factors. I always counter that you never know what is round the corner in business, that is why flexibility is key.
I dont read
Looks to me like Groovy outperformed JRuby in many ways. I don't see what you are talking about. And it's still only in BETA!
This is my sig. There are many like it but this one is mine.