Slashdot Log In
Ruby Implementation Shootout
Posted by
ScuttleMonkey
on Mon Feb 19, 2007 02:04 PM
from the always-with-the-shooting dept.
from the always-with-the-shooting dept.
An anonymous reader writes "Ruby has an ever growing number of alternative implementations, and many of these attempt to improve the suboptimal performance of the current mainstream interpreter. Antonio Cangiano has an interesting article in which he benchmarks a few of the most popular Ruby implementations, including Yarv (the heart of Ruby 2.0), JRuby, Ruby.NET, Rubinius and Cardinal (Ruby on Parrot). Numerical evidence is provided rather than shear opinions. The tests show that Yarv is the fastest implementation and that it offers a promising future when it comes to the speed of the next Ruby version."
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
Read the disclaimer... (Score:3, Insightful)
Cardinal interesting (Score:4, Interesting)
I can't tell if those fast tests are so trivial that they offer little chance of further speedup, or whether YARV, which has had speed as a goal, is not going to be so much faster than a Parrot-based implementation once it (Cardinal) gets into working on optimization.
Anyone interested in providing some information on where the YARV performance comes from and whether Cardinal is likely to approach it more closely and farther across the board in the tests?
Re: (Score:2, Insightful)
Re: (Score:2)
You have to figure out the equivalent tasks(Mandelbrot seems to be be one) and then flip between the two benchmark pages.
Re: (Score:2)
A shear opinion... (Score:2, Funny)
Try "sheer".
Java not slow enough for you? Try Ruby! (Score:4, Insightful)
Re: (Score:3, Insightful)
Re: (Score:3, Insightful)
Except speed of code development.
So for my one-off scripts that run for 45s in ruby instead of 0.1s in perl, well
what's mattered to me is that it took 5 mins to write, rather than the 90mins +
a brain tumor that perl does*
* I last used perl at about 4.036, tried to get into "objects" with perl 5, and
jumped to ruby for the sake of my sanity.
Re: (Score:3, Insightful)
400 times slower? Still too efficient. Consider a Ruby implementation on the JVM and multiply inefficiencies! Should be thousands of times slower for those same benchmarks.
About JRuby; Sun recently hired [slashdot.org] two (both?) of the JRuby developers and progress has accelerated [codehaus.org]. The promise is a highly capable Ruby implementation running on a JVM. This, coupled with very recent changes to the JVM [artima.com] to facilitate scripting langua
Any YARV experts (Score:3, Insightful)
Re:Any YARV experts (Score:4, Informative)
Slightly less short answer: if I'm not mistaken, YARV includes a JIT compiler, similar to what Psyco [sourceforge.net] does in the Python world. Psyco has been known to accelerate code execution up to 100x times, so I'd expect YARV to be even faster than this benchmark shows when it's stabilized.
Parent
Re:Any YARV experts (Score:5, Insightful)
This rule isn't exactly hard and fast, as verying implementations of VMs and interpreters can have different performance characteristics. For example, while perl is still probably considered an interpreted language, it's quite fast due to the interpreter using many compiler tricks such as parse tree optimizations. The ruby interpreter however has been notoriously slow, which is why ruby people are so excited about it.
Parent
unicode? (Score:3, Interesting)
Ruby and Unicode (Score:3, Interesting)
Why not use C (Score:4, Funny)
Re: (Score:2)
hmmm...Could it be the object-oriented programming language Ruby?
Ruby [wikipedia.org]
Re:so... ruby? (Score:5, Informative)
I was on the same boat until a couple of weeks ago ... anyway, Ruby is The Hottest Thing Since Sliced Bread (TM). It's a programming language that was created in Japan all the way back in 1995. However, it has only just recently garnered mainstream interest due to the emergence of a web application framework built on Ruby, which is called Ruby on Rails and is said to be an incredibly well-thought and efficient framework.
More on Ruby here [wikipedia.org].
And more on Ruby on Rails here [wikipedia.org].
I personally have an enormous interest in Ruby on Rails, as it seems to be a very neat way of writing web applications, but I'm also a bit daunted; it's a new language and a whole new framework with different ways of doing things, so it's been slow going learning it. I just wish I knew where to get some extensive sample code to peruse - that's how I learn best. All I've seen are some very basic applications which don't really teach you the real tricks and show how it all comes together.
Parent
Re:so... ruby? (Score:5, Informative)
Yes, Ruby is the current web development flavor of the month, however, don't get caught up in the hype. There are good number of MVC web development frameworks in other languages, including even Lisp and Smalltalk, but most notably Python. In my opinion it makes more sense to learn a Python framework for a number of reasons. Mainly because Python is used in considerably more non-web applications than Ruby, which makes your skills more portable (and you more employable). Ruby on Rails is also very monolythic, while two of the the three most popular Python frameworks, TurboGears [turbogears.org] and Pylons [pylonshq.com] are very modular (especially Pylons since it's built around the WSGI [wsgi.org] spec). Finally, Python compiles to bytecode whereas Ruby does not. Hence Python outperforms Ruby in almost every shootout [debian.org].
Further reading:
Of snakes and rubies; Or why I chose Python over Ruby [infogami.com]
TurboGears and Pylons (a technical comparison) [ianbicking.org]
From PHP to Python [rightbrainnetworks.com] (my blog)
Parent
Re: (Score:3, Informative)
Re:so... ruby? (Score:4, Insightful)
I find it amusing someone would say learn Python because it's used more. Python may be older, but it's still sitting in the programming language high chair right next to Ruby. People say the same thing about Python; "if you want a job learn Java, c#, c++"; and you know what they're right, if you want a job learn Java, period.
I like both Ruby and Python, and I think a programmer would do well to learn one or both. They aren't as popular yet, like Java or c#, but I think they will be. And if you understand the concepts in one, you'll understand the other. Like Gretzky said, "I skate where the puck is going to be, not where it is"; good advice.
I prefer Ruby, but that is just a preference.
Parent
Strings as objects (Score:4, Interesting)
Well, you can also do it in Java .....
String a = "Hello".toLowerCase().toUpperCase();
.... but I'm not sure it makes a huge difference in real software development. I do however like it as the safe test for an exact match without worrying about null ....
if ("FOO".equals(a)) {
Parent
Re:so... ruby? (Score:4, Funny)
Numerical evidence is provided rather than shear opinions.
Do those opinions come from sheeple?
Parent
Re:so... ruby? (Score:5, Informative)
Parent
Re: (Score:3, Insightful)
And when will that happen, exactly? I've been hearing about R/RoR for years now, and it's still distinctly in the low-performance category. Yet every time I go visit the site for updates all I see is talk about how they're adding feature X and Y in the next point release.
These guys need to stop dinking with the language, freeze it, and work on fixing bugs and increasing performance so people out here in the real world can actually u