Slashdot Mirror


Ruby 1.9.1 Released

Janwedekind writes "Yuki Sonoda yesterday announced the release of Ruby 1.9.1 (Ruby Inside coverage with lots of links). The VM of Ruby 1.9, formerly known as YARV, was initiated by Koichi Sasada and has been in the making for quite some time. Ruby's creator Yukihiro Matsumoto has already presented many of the upcoming features in his keynote at RubyConf 2007. Most notably, Ruby 1.9 now supports native threads and an implementation of fibers. A lot of work also went into encoding awareness of strings. The 1.9.1 version is said to be twice as fast as the stable 1.8.7. It will take some time though until the majority of existing Ruby extensions get ported to 1.9."

9 of 226 comments (clear)

  1. Re:Ruby vs Python by nicknicknick · · Score: 4, Insightful

    Python is skiing and ruby is snow boarding. One's more fun than the other but they are more similar than different.

  2. Re:I am afraid, there is lack of direction for Rub by Chandon+Seldon · · Score: 5, Insightful

    On a side note, I will use PHP on my servers before touching Ruby since I see no advantages for using it over PHP.

    Choice of programming language actually matters, and dismissing languages you haven't used much is foolhardy. If this isn't obvious to you, this article may prove enlightening.

    --
    -- The act of censorship is always worse than whatever is being censored. Always.
  3. Re:I am afraid, there is lack of direction for Rub by AuMatar · · Score: 4, Insightful

    No, it really doesn't. What matter is availability of libraries, and your personal profficiency with the language. Given C and a regex library, I'll write better, cleaner, and faster doing string parsing than I would in perl. Why? Because I've used C and C++ every day for the past 8 years. Even though I use and know perl and regex is built into the language, I make more mistakes in it due to using it only a few times a year. And yes, I've actually tried this- I was 5x faster in C with the regex library. Do the test again with a perl maven, and I'm sure the opposite result would occur, even if you gave a problem that's more traditionally a C thing.

    Now there are some languages that better suit individual people than other languages, due to the way they approach problems. Lisp is good for people who think very mathematically. C is good for those who think in a very step by step manner. OOP is good for people who think in terms of models and interactions. But you'll always be more efficient in a language you know well than one thats new to you.

    Which isn't to say there's no reason to learn a new language- you may find one that fits you a bit better, especially if you learn a new paradigm like functional. But you'll never solve a problem quicker by using a language you aren't as familiar with, unless a library for a major piece of functionality exists in that language but not yours.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  4. Re:Twice as fast... by jcupitt65 · · Score: 3, Insightful
    Ruby 1.9 is roughly competitive with PHP in the Alioth Shootout (not a great benchmark I know, but interesting):

    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=yarv&lang2=php

  5. Re:Twice as fast... by subreality · · Score: 4, Insightful

    Except that slideshow is comparing the performance of popular frameworks for different languages. So they're showing that Rails is an efficient framework. That's a perfectly valid point to make (the language makes it easy to write a better algorithm, or maybe the framework is just more efficient), but it doesn't say anything about how fast the code is executed.

    I switched from Perl to Ruby as my everyday sysadmin and glue language, and I use it pretty extensively. I love Ruby, but I won't try to handwave away its faults. In my usage, it's undeniably, dramatically, slower than Perl. We're talking order of magnitude here, not marginal stuff that only shows up in benchmarking.

    A script to parse a huge, complex data file sucks ten times as many CPU cycles to do the same work. For what I do, that's OK, because the ten minutes to run the job is completely dwarfed by the development time saved by using a sane language.

  6. Re:I am afraid, there is lack of direction for Rub by SanityInAnarchy · · Score: 3, Insightful

    Hardware is only cheap if someone else is paying for it.

    No, hardware is cheap, relative to programmer time. Moore's Law only reinforces this. In fact, you're making my argument for me:

    Why spend money you don't have to?

    Let's suppose it takes me half the time to code it in Rails than it does to code it in PHP, but requires twice the power to run. And let's suppose I make minimum wage.

    Before it even comes close to costing more to run the hardware than it does to run my salary, you're already running six or seven extra-large instances. Go look up the specs for an extra-large instance. And keep in mind, that's additional -- that assumes the optimized version requires six or seven of those, and my inefficient version requires six or seven more.

    You can run the numbers yourself, but it ultimately tends to work out the same. And all of that assumes the Ruby version is slower -- and, following my link above, it really isn't.

    Smaller organizations won't save millions, but they'll save a significant chunk of cash.

    Smaller organizations, I would think the "just throw hardware at it" argument makes even more sense. The speed of a nonworking app is irrelevant. The speed of an app serving a dozen programmers and testers, before public release, is similarly irrelevant. By the time you're getting hundreds or thousands of requests per second, you're probably making enough money from ads alone to cover the costs -- but while you're still "only" getting dozens of requests per second, a single Rails server might work just fine.

    Now, I agree, throwing hardware at it is not a good long-term solution. The good long-term solution is to optimize the better systems. However, investing in a demonstrably worse architecture to gain a little performance -- maybe -- in the short term, does not seem like a good move.

    --
    Don't thank God, thank a doctor!
  7. Re:Twice as fast... by John+Allsup · · Score: 4, Insightful

    It has always been 'fast enough' for appropriate programming problems. If Ruby is too slow, you're in the wrong problem domain to use Ruby.

    Note that there is, and can never be, OneTrueLanguage(TM).

    Efficient development is all about playing to the advantages of the development tools available to you. Complaining about weaknesses is usually indicative of a lack of understanding.

    --
    John_Chalisque
  8. Re:Ruby vs Python by gatkinso · · Score: 4, Insightful

    One has to wonder if you actually ski or snowboard. Other than the fact that they are both done on snowy downhill slopes, there is no similarity.

    --
    I am very small, utmostly microscopic.
  9. Re:I am afraid, there is lack of direction for Rub by An+Onerous+Coward · · Score: 3, Insightful

    > Besides, inefficient code will add up almost exponentially as your load increases.

    Eh?

    We're not talking about poor algorithm selection. We're talking about using a slower language rather than a faster language. Unless you deliberately adopt a "slower languages deserve slower algorithms" mentality, you're talking about a linear increase in hardware.

    In that case, doubling the hardware requirements in exchange for even a 25% cut in coding time is going to be a huge boon for your company. If writing in a cleaner, more elegant language makes the code base smaller and easier to read, those senior developers are going to have a much easier time finding the bugs and the bottlenecks. Plus, if you can write the thing that much faster, your developers are going to have a lot more fun.

    Since we're talking specifically about Rails here, the first optimization pass is usually A) finding pages and partials that can be cached, and B) tweaking your ActiveRecord queries so that the database grabs all the records it needs on the first pass. Both are simple to do, and once you've accomplished them it's going to be quite a while before a normal site is going to run into scaling issues.

    --

    You want the truthiness? You can't handle the truthiness!