Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Ruby Implementation Shootout

Posted by ScuttleMonkey on Mon Feb 19, 2007 01:04 PM
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.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Read the disclaimer... (Score:3, Insightful)

    by tcdk (173945) on Monday February 19 2007, @01:14PM (#18069542)
    (http://tc.dk/ | Last Journal: Friday August 27 2004, @01:57AM)
    This being /. I don't expect anybody to actually read the acticel, but before you begin your rant^H^H^H^H ... post about how these tests are useless etc. etc. please, at least read the article disclaimer:

    Don't read too much into this and don't draw any final conclusions. Each of these exciting projects have their own reason for being, as well as different pros and cons, which are not considered in this post. They each have a different level of stability and completeness. Furthermore, some of them haven't been optimized for speed yet. Take this post for what it is: an interesting experiment;
    Now fell free to begin your rant about it being a slow news day...
  • Cardinal interesting (Score:4, Interesting)

    Though not familiar with the project, I'm impressed that the project with by far the most errors (Cardinal), indicating I assume that the least work has been done on it, is still so close to YARV - only 2-4 times slower in a couple tests.

    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?
  • cool (Score:1)

    by jrwr00 (1035020) <jrwr00@gmail.com> on Monday February 19 2007, @01:20PM (#18069666)
    (http://blog.woodysroom.com/)
    they need to post the specs of the computer they where using tho, i could post numbers, but i would be running it on a p1 150mhz!
    • Re:cool by h4ter (Score:1) Monday February 19 2007, @04:25PM
    • 1 reply beneath your current threshold.
  • A shear opinion... (Score:2, Funny)

    by Ancient_Hacker (751168) on Monday February 19 2007, @01:30PM (#18069802)
    A shear opinion is like, a comment about Britney's latest screwup.

    Try "sheer".

  • by Jagasian (129329) on Monday February 19 2007, @01:34PM (#18069870)
    Performance isn't everything, but then again, when you are 400 times slower than Java [debian.org]... performance starts to matter.
  • Any YARV experts (Score:3, Insightful)

    by Timesprout (579035) on Monday February 19 2007, @01:40PM (#18069948)
    Can anyone comment on why the YARV implementation is so much faster than the standard implementation? I know for example the SUN VM was originally only intended as a reference VM and faster implementations were developed but not on the scale of the differences highlighted here.
    • Re:Any YARV experts (Score:4, Informative)

      by Balinares (316703) on Monday February 19 2007, @02:01PM (#18070298)
      (http://slashdot.org/)
      Short answer: various things, compilation to bytecode before execution (I thought it was the case in the current interpreter, but might have been mistaken), etc.

      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)

      by mo (2873) * on Monday February 19 2007, @02:17PM (#18070576)
      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.

      [ Parent ]
  • unicode? (Score:3, Interesting)

    by bcrowell (177657) on Monday February 19 2007, @02:15PM (#18070536)
    (http://www.lightandmatter.com/)
    What's up these days with ruby and unicode? Of these implementations, do some do it one way and some another?
  • by kahei (466208) on Monday February 19 2007, @02:36PM (#18070842)
    (http://www.hwacha.net/)

    I don't think anyone decides to use Ruby based on performance, really. I'd be a lot more interested to hear whether any new features (notably, proper Unicode strings and native threads) are included in any of these implementations -- I really can't use Ruby without at least the former. I would have thought the Java and .NET implementations would be able to do these without too much trouble -- I'm well aware of the difficulty of working around the issues in the original C implementation but they are all just that, implementation issues.

    I'd also be interested in standardization -- currently IIRC Ruby is specified as 'whatever Matz's implementation is observed to do, that's Ruby'.

  • I would use Ruby more if the runtime performance were better. For speed and dynamic language niceness I use Franz Common Lisp for most of the work for my current customer (AI medical applicaion) and I still find myself using Java a lot for serverside deployment goodness :-)

    I would have prefered Ruby, BTW, because it is easy to train people in Ruby development while Common Lisp is a harder learning curve.

    Once Yarv is very stable (maybe it is already?), then I will use Ruby for a larger percent of my new projects.
  • by trimbo (127919) on Monday February 19 2007, @03:11PM (#18071324)
    (http://trimbo.blogspot.com/)
    This study backs up what everyone who has tried Ruby on Windows already knows... it stinks! I'm actually not surprised to see that some of their tests errored out completely on Windows, even with the Ruby 1.8.5 binary.

    Granted, Ruby is mostly used with Rails right now, but you'd think that if the language proponents want the language to take off, Windows support would be taken more seriously. In the couple years since I first tried Ruby, it doesn't seem like it has improved much at all.
  • Why not use C (Score:4, Funny)

    by zymano (581466) on Monday February 19 2007, @03:41PM (#18071732)
    C and cgi.
  • Re:so... ruby? (Score:1, Informative)

    by Anonymous Coward on Monday February 19 2007, @01:13PM (#18069536)
    Check out http://www.ruby-lang.org/ [ruby-lang.org]
    [ Parent ]
  • Re:so... ruby? (Score:2)

    by brunokummel (664267) on Monday February 19 2007, @01:18PM (#18069632)
    (Last Journal: Wednesday August 09 2006, @06:22PM)

    Can they update the article to give a brief blurb on what ruby is? Or is it something that has become so commonplace in the past 2 weeks that i'm a doof for not knowing?

    hmmm...Could it be the object-oriented programming language Ruby?
    Ruby [wikipedia.org]

    [ Parent ]
  • Re:so... ruby? (Score:5, Informative)

    by spellraiser (764337) on Monday February 19 2007, @01:18PM (#18069640)
    (Last Journal: Wednesday February 14 2007, @09:49AM)

    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)

      by XorNand (517466) * on Monday February 19 2007, @01:42PM (#18069964)

      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:so... ruby? by daeg (Score:3) Monday February 19 2007, @02:18PM
      • Re:so... ruby? (Score:4, Insightful)

        by Stamen (745223) on Monday February 19 2007, @02:45PM (#18070980)
        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.

        [ Parent ]
      • Re:so... ruby? by Paulrothrock (Score:2) Tuesday February 20 2007, @09:55AM
      • 1 reply beneath your current threshold.
    • Re:so... ruby? by Anonymous Coward (Score:1) Monday February 19 2007, @01:49PM
    • Example Code by The Raven (Score:2) Monday February 19 2007, @05:51PM
    • One Criticism of Ruby, But a Major One by nikster (Score:2) Tuesday February 20 2007, @02:41AM
      • 1 reply beneath your current threshold.
    • Re:so... ruby? by meiao (Score:1) Wednesday February 21 2007, @01:39PM
  • Re:so... ruby? (Score:1)

    by pkulak (815640) on Monday February 19 2007, @01:23PM (#18069692)
    If there is anything that doesn't have to be defined on /., it's Ruby.
    [ Parent ]
  • Re:so... ruby? (Score:5, Informative)

    by Phrogz (43803) <gavin@refinery.com> on Monday February 19 2007, @01:31PM (#18069820)
    (http://phrogz.net/)
    Ruby is a dynamically typed, strongly typed, runtime-interpretted, very object-oriented programming language. It was created about the same time as Python (10+ years ago?), but is less well-known in the United States as it originated in Japan. It is the langauge that the Ruby on Rails [rubyonrails.com] web framework is based on. See the official Ruby website [ruby-lang.org] for more information.
    [ Parent ]
  • Re:so... ruby? (Score:1, Insightful)

    by Anonymous Coward on Monday February 19 2007, @03:15PM (#18071384)
    Don't be such a pure functional twit. A little 'state'-ment at the top of the page about how Ruby is an OO scripting language/interpreter of the curly-brace variety hailing from Japan would be nice. You may find state offensive, but it can save time.
    [ Parent ]
  • "Shear" opinions (Score:1, Funny)

    by Anonymous Coward on Monday February 19 2007, @04:04PM (#18072180)
    from TFA:
    Numerical evidence is provided rather than shear opinions.

    Would that be what the author thinks about scissors? For the semi-literate that should be "sheer opinion," not "shear opinions."
    [ Parent ]
  • 9 replies beneath your current threshold.