From: Sky Yin Date: 2006-02-24T12:39:35+09:00 Subject: Re: Huge performance gap ------=_Part_9_16187060.1140752358324 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 100 times is normal. Just use ruby for where it works well and use compling language for computation-intensive tasks. If you look at other languages, there's still a gap (about 5 times) between VMs without JIT and ones with JIT. Good news is that now we have .Net ruby bridge. Prototyping in ruby an= d optimizing critical part in .net sounds very efficient and productive. Sky On 2/23/06, Alexis Reigel wrote: > > Hi all > > I've ported the following c++ code to ruby. It is a recursive > (backtracking) sudoku-solving algorithm. Well, I was rather surprised by > the execution time I got: > > c++ code: 0.33 seconds > ruby code: 27.65 seconds > > The implementation should do the same, at least they run through the > method/function "next_state"/"nextone" both 127989 times. > > Now how can it be that the ruby code is so awfully slow? > Is that normal for ruby? > Or is my implementation so horribly bad? > I am aware that the non-native and object-oriented ruby code won't be as > fast as the c++ one, but I didn't expect such a gap. > > > Thanks for comments. > > Alexis. > > > > -- Blog >>> http://spaces.msn.com/members/skyincookoo ------=_Part_9_16187060.1140752358324--