From: Alexis Reigel Date: 2006-02-24T07:55:47+09:00 Subject: Re: Huge performance gap Stephen Waits wrote: > E. Saynatkari wrote: > >> >> Post the code somewhere, there might be room for improvement >> in the algorithm though it will still be considerably slower. > > > It looks, to me, like he attached his code to the OP. > > Regardless, it doesn't matter. Algorithmic improvements may help both > 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++.