From: Michael Neumann Date: 2004-11-06T07:00:23+09:00 Subject: Re: Ruby is a slow performer On Sat, Nov 06, 2004 at 06:31:33AM +0900, David G. Andersen wrote: > On Sat, Nov 06, 2004 at 06:23:41AM +0900, Christian Szegedy scribed: > > gabriele renzi wrote: > > > > >About the shootout. Most of the stuff is plan useless in ruby. > > >You won't implemente heapsort in ruby, cause you have sort/sort_by. > > >Nor you would use > > >http://shootout.alioth.debian.org/lang/ruby/random.ruby.html > > >because you have rand(). > > > > You are correct. I would say that the shootout is extremely > > misleading, for example the Python people do dubious tricks > > to make it look fast: for example the matrix multiplication is > > implemented by calling the an extension method. > > Why is that unrealistic? You could do the same in Ruby by > implementing the library 'Matrix' class in C. We already have > a library that handles the stuff; it's just a matter of > optimization (== time == extra code in C that's harder to > maintain, unfortunately). I actually played with this a bit. > Right now, using the Ruby matrix class does two things to > that test: > > a) Reduces the lines of code by nearly half > b) Increases the runtime by a factor of two. (ouch) > > If we had a superfast matrix class, it would give (a) along > with decreasing the runtime by a factor of ten or so. Sounds We have a superfast matrix class: NArray (not in standard lib). It claimed to be 3x faster than NumPy for some tests and a bit faster than Octave for for matrix operations. http://www.ir.isas.ac.jp/~masa/ruby/index-e.html Regards, Michael