From: Seth Kurtzberg Date: 2003-02-27T17:52:46+09:00 Subject: Re: Is Ruby slower? On Thursday 27 February 2003 01:45 am, Lennon Day-Reynolds wrote: > As an informal benchmark, the "Language Shootout" would seem to suggest > that Ruby's method dispatch is indeed a good bit faster: > > http://www.bagley.org/~doug/shootout/bench/methcall/ > > Specifically, there's over a 2x difference in the execution time for the > specific test used for that data. In addition, the 'Object Instantiation' > test showed an even more dramatic difference, with Ruby almost 5x faster. > > Of course, to be fair, in its more traditional strong areas, (regexp > matching, hash access, etc.) Perl shows an equal or better advantage. That may be true, but it is a lot easier to optimize the regexp library (for example) than to change the instantiation and dispatching methods. Also, it is largely not a valid comparison, as Ruby is the only language (of the "usual suspects" :) ) that is in fact really OO. So, for example, Perl is doing pseudo-OO more slowly than Ruby is doing real OO. > > So, not too surprisingly, the performance is likely to depend far more on > the style of code you're writing, algorithms and data structures used, > etc., than on the implementation language, at least among the "usual > suspects" (Ruby, Perl, Python, etc.). > > Lennon Day-Reynolds > lennon@day-reynolds.com > > On Thu, 27 Feb 2003 12:57:54 +0900 > > ptkwt@shell1.aracnet.com (Phil Tomson) wrote: > > In article <20030227002438.GA3877@math.umd.edu>, > > > > Daniel Carrera wrote: > > >Hello, > > > > > >I was wondering about what exactly makes Perl faster than Ruby, and I > > > made a small test to examine this a bit. I sort of assumed that it was > > > because Ruby has more powerful data structures, but it seems that > > > compile-time optimization might be a significant factor. > > > > Actually, at the last meeting of the Portland Rubyists we had a new > > person show up who apparently does a lot of OO Perl and from what he > > said, for OO programs Ruby is faster because Perl is a lot slower at > > method dispatch. Anyone else got any data on this? > > > > Phil -- Seth Kurtzberg M. I. S. Corp. 480-661-1849 seth@cql.com