From: JB Eriksson Date: 2005-11-04T06:40:57+09:00 Subject: Re: Ruby Performance vs. Java ------=_Part_18298_26865382.1131054054751 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline OTOH, if speed really was the issue, one should go with ASM or something. M= y grasp on the ruby philosophy isn't just to write the most efficient code, but to have fun while writing it. /Johan On 11/3/05, MenTaLguY wrote: > > On Fri, 2005-11-04 at 05:45 +0900, Robert Bazinet wrote: > > I am new to this list and Ruby in general. I had read a blog post > recently > > that concerned me a bit, > > http://www.pankaj-k.net/archives/2005/11/ruby_or_java_a.html. > > > > The post points out two apps written to do the same task the same way, > one > > in Java and the other in Ruby. The Java application turned out to be 12= x > > faster than the Ruby app. I know we are not really comparing apples to > > apples here but I was wondering if there are any real-world test result= s > out > > there that show Ruby's performance vs. other languages and where Ruby > stacks > > up. > > In most cases, the same algorithm implemented in Java and in Ruby is > going to be faster/more memory-efficient in Java, at least with the > current Ruby implementation (there is no "Ruby VM" as the author > supposes; the current interpreter just walks an AST). > > However, Ruby can often make more efficient algorithms easier to write > and use (hence the performance benefits that have been observed with > Rails). > > If speed is your most important criterion, for which all others must be > sacrificed, Ruby is (probably) not the right language; but usually there > are other factors, like programmer time -- especially for personal > projects!. In those cases, the analysis that needs to be made is > whether a language is fast enough for your specific task. > > If anyone offers you a universally applicable "performance metric", it > is an illusion. > > -mental > > > ------=_Part_18298_26865382.1131054054751--