From: "E. Saynatkari" Date: 2006-02-24T08:02:22+09:00 Subject: Re: Huge performance gap Alexis Reigel wrote: > Stephen Waits wrote: >> the C++ and Ruby versions - but it's not going to change the fact that >> one is a relatively low-level language, compiled to native machine code, >> and the other is an interpreted dynamic language. To compare them is >> either ridiculous, or more likely in this case, simply ignorant. >> >> --Steve >> > Why should that be ridiculous or ignorant? > I stated that I was aware of the differences between interpreted and > compiled languages. But that does not change the fact that I believe > that this does not explain the performance gap. An execution time of > 27.65 seconds against 0.33 seconds is not just nothing is it? It's a > factor of over 80 times. Besides, I implemented the same code in java > too, which isn't native code as well and runs in a virtual machine too, > and it executed in about the same time as c++. Well, Ruby is strictly interpreted using the parse tree instead of VM opcodes which may or may not (depending on who you ask) make a difference. Ruby is pretty slow but usually Fast Enough(tm). You could try to run your script on YARV[1] to see if it helps. [1] http://atdot.net/yarv E -- Posted via http://www.ruby-forum.com/.