Slashdot Mirror


Ruby Implementation Shootout

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."

4 of 112 comments (clear)

  1. Java not slow enough for you? Try Ruby! by Jagasian · · Score: 3, Insightful

    Performance isn't everything, but then again, when you are 400 times slower than Java... performance starts to matter.

  2. Re:Any YARV experts by mo · · Score: 4, Insightful

    The standard 1.8.X Ruby interpreter is a single-pass interpreter, and YARV is a virtual machine implementation. You can expect big improvements when moving to a VM implementation from an interpeter. The reason Java has never had such big improvements is that it's always been based on a VM.

    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.

  3. Re:so... ruby? by Stamen · · Score: 4, Insightful

    Minor note, Ruby on Rails is the web development flavor of the month, not ruby. There are a lot of interesting things happening in plain ole ruby, plus there are other web frameworks than Ruby on Rails, such as Nitro, Camping, etc.

    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.

  4. Re:Java not slow enough for you? Try Ruby! by Rufty · · Score: 3, Insightful

    Yep, I agree. Ruby's slow. Probably slower than the rest at just about everything.
    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.

    --
    Red to red, black to black. Switch it on, but stand well back.