A Faster Ruby.
[Devil's Advocate (Dvl) talks to Ruby Advocate (Rby). Inspired by ruby forum discussion, via Scott Hanselman.] Dvl: Ruby has poor computational performance. Rby: What? No it doesn't. Dvl: Yes it does. You ruby people are in denial about the whole topic of Ruby's poor computational speed. Rby: Denial? What? No we're not! Look over there! Dvl: Yes you are. Try and say it with me "computational performance." Rby: Comp... u... tay... What about developer performance, hey? Developer productivity is more important. Elegance, beauty, blah blah, love-ins, simplicity Dvl: Well if Ruby developers are so damn productive, why can't they write a faster ruby? Rby (covering ears and shouting): SHUT UP! SHUT UP! SHUT UP!
'Haacked' on Wed, 14 Mar 2007 04:16:32 GMT, sez: I think you need to start a new blog called "The Devil's Advocate". I can be your straight man. I'll be the "The Advocate". You can be, "The Devil".
Great post!
'lb' on Wed, 14 Mar 2007 04:22:18 GMT, sez: just clearing a little unwanted negativity out of my brain...
it did occur to
me recently that the
performance problems in
ruby probably aren't a prob
lem at all for any of the plac
es where i'd use it. and of
course you'd want to me
asure it... if it's
worth taking the
time to do that. (
you'd also want to meas
ure how long it takes to
measure the... stack overflow)
'Adi' on Wed, 14 Mar 2007 06:37:21 GMT, sez: Scott Hanselman also mentioned the beauty vs. performance problem of Ruby with his most recent post.
'Rik Hemsley' on Wed, 14 Mar 2007 06:41:00 GMT, sez: Ruby 2.0 will use a VM which executes code quite a bit faster than the current interpreter.
http://www.antoniocangiano.com/articles/2007/02/19/ruby-implementations-shootout-ruby-vs-yarv-vs-jruby-vs-gardens-point-ruby-net-vs-rubinius-vs-cardinal
Personally, I'm not really affected by Ruby being 'slow' except when I'm processing XML with REXML.
'Mike Woodhouse' on Wed, 14 Mar 2007 08:00:11 GMT, sez: It's all horses-for-courses, isn't it. I wouldn't write an ad hoc C# program to do a one-off text file analysis and I wouldn't write a Ruby program to implement a neural network. To take two examples of stuff I've done.
Actually, I've done both of those tasks in both languages (because I'm perverse). The text analysis stuff was written and run in Ruby in less time than the C# program took to be debugged (although it ran heaps faster: about 0.05 sec against maybe 1.00 for Ruby). And I got the NN code working much faster in Ruby but all it was good for, performance-wise, was providing a prototype for the C# implementation.
'Eddie Paz' on Wed, 14 Mar 2007 16:23:58 GMT, sez: I don't want to start a religious war on this, but why would one use Ruby when there's Perl. I haven't used much Ruby, but I haven't heard much good about - just like this performance issue.
'Try Ruby' on Wed, 14 Mar 2007 20:33:40 GMT, sez: @Eddie ("why would one use Ruby")
Try ruby out, online at http://tryruby.hobix.com/
and see for yourself.
it's very different to perl.
'Haacked' on Wed, 14 Mar 2007 22:07:51 GMT, sez: I hope Eddie was joking. "PERL"? Seriously? Ha ha. good one. I mean, any number of languages you could have mentioned. Python. Lisp. But Perl?
'lb' on Wed, 14 Mar 2007 22:32:39 GMT, sez: >I hope Eddie was joking
don't take the bait Phil! step away from the flame war...
'Chrisnp' on Wed, 14 Mar 2007 22:56:29 GMT, sez: Whatever. {blah-blah-blah}, but Rails will scale nicely for almost anything, you (and I) people, will ever write. You can write a NN in Ruby that will execute much faster when you translate it to OCaml, but C#?
I mean, do the prototype in Ruby, translate it and you are still left with enough time for a quick cup of coffee until the C# implementation's done, eh?
'Devil's Advocate' on Wed, 14 Mar 2007 23:06:39 GMT, sez: >do the prototype in Ruby, translate it
okay -- so if that's easy to translate ruby into OCaml why not write a ruby interpreter that does this -- and gives better performance than the current one?
(reason is probably because translating ruby to OCaml isn't a no-brainer in all cases... hence ruby's performance is fundamentally broken and moving it to a VM or faster implementation isn't possible)
'rick' on Wed, 14 Mar 2007 23:21:37 GMT, sez: Ruby programmers are more productive writing ruby, not c. I'd guess that most ruby programmers are very unproductive in c in fact.
'Devil's Advocate' on Wed, 14 Mar 2007 23:28:02 GMT, sez: >Ruby programmers are more productive
>writing ruby, not c.
AFAIK, ruby programs can be translated to c.
and ruby programmer are productive at writing programs to lex and parse text because there are great facilities in the language for this.
hence, a ruby programmer can write a ruby interpreter in ruby, then translate it to c.
hey presto, a faster ruby implementation.
'MIlesZS' on Thu, 15 Mar 2007 01:39:27 GMT, sez: You guys are all aware that there are projects in the works that will implement a faster Ruby, right? You're aware that the creator of Ruby thinks his implementation is slow, and that's why Ruby 1.9 (due in November) will have a new implementation?
I mean, at this point, the original poster, and the comments are all just masturbation. I hope you all go blind.
'Eddie' on Fri, 16 Mar 2007 11:12:36 GMT, sez: >>I hope Eddie was joking
>don't take the bait Phil! step away from the flame war...
That wasn't a bait, I swear. But I'm glad I didn't get crushed by Ruby evangelists (I wouldn't dare asking that in the Ruby forums :)
I compared it to Perl since it's the one I know that Ruby compares to. I haven't had the pleasure to use Lisp or Python.
Now that I've taken my foot outta my mouth, I'm checking the Ruby online tutorial someone posted above. I'll come back in a couple of weeks and be the Devil's advocate for LB.
'vance' on Fri, 16 Mar 2007 21:57:31 GMT, sez: @Eddie
You would use Ruby because you like PERL but you also like JAVA. Ruby take PERL to the next level and dumbs down JAVA so that 1 person can write an application.
As much as Ruby developers like to posit Ruby as antithetical to PERL and JAVA it really isn't, it's a nice combination of the two with a little scheme/lisp thrown in for good measure. However I think they realized they'd written the perfect language so they sprinkled the interpretor with random sleep(10)'s to make it painfully slow, just so the rest of the world wouldn't feel bad.
'Eddie' on Fri, 16 Mar 2007 23:07:06 GMT, sez: I hope they stop feeling bad and remove the sleep calls. As I'm looking more into it, it does look like what you describe. They must be doing something good since a new Ruby section has been added to this year's SD conference http://www.sdexpo.com. I'm definitely keeping my eye on this one.
'toys' on Mon, 03 Sep 2007 05:58:02 GMT, sez: Once again, I think, we miss a little of the point about coding and programming languages here – context. Certain languages are to be used for certain duties, certain others for other duties. Ruby is fantastic, but works the best when it is used for what it was created for. Although, it's great that sometimes languages can be used for other developments as well, sometimes it's just more sensible to use the right tool for the right job.
'jose' on Wed, 03 Oct 2007 07:09:16 GMT, sez: For the fastest pure-Ruby Fibonacci method see http://snippets.dzone.com/posts/show/3562 (just as an example)
'birthday gifts' on Mon, 15 Oct 2007 09:49:25 GMT, sez: Ruby doesn't really need to be faster (though, it could help) because it is a specific language that works well for specific jobs. You're not going to use Ruby to program a flight simulator. Use Ruby for what it's good for, use others for what they're good for. While Python, I think, is a fantastic alternative – sometimes Ruby just wins over it in some respects, while Pythons wins over Ruby in other respects. Comparing them is not a fair thing to do at all, in my opinion. If they can't do the job they're designed for, then by all means throw them away. But if they can, then why are you trying to use them for something else? You don't use your dishwashing soap to wash your hair.
'maclaren' on Sun, 21 Oct 2007 23:14:40 GMT, sez: Thanks for stuff.I was looking at the material a long time.
'portrait artist' on Wed, 09 Jan 2008 06:34:15 GMT, sez: Interesting post! I can’t wait to hear another update regarding this matter.
|