From: Kristof Bastiaensen Date: 2006-08-05T18:30:04+09:00 Subject: Re: For performance, write it in C - Part 3, Source code now available On Sat, 05 Aug 2006 08:31:30 +0900, ara.t.howard wrote: > On Sat, 5 Aug 2006, Isaac Gouy wrote: > >> >> ara.t.howard@noaa.gov wrote: >>> On Sat, 5 Aug 2006, Peter Hickman wrote: >>> >>>> Perhaps stepping up to a 6 x 6 grid would allow more meaningful timings? >>> >>> showing how it performs on a 2, 4, and 8 grid would show how it scaled... >>> >>> -a >>> -- >>> happiness is not something ready-made. it comes from your own actions. >>> - h.h. the 14th dali lama >> >> It scales badly >> >> 0.496s gcc 5x5 (without print statements) >> 30055.098s gcc 6x6 (without print statements) >> >> imo If Peter has figured out what he's trying to do then it would be >> smart to find a better way of doing it rather than scrabbling for small >> percentage improvements. > > indeed - that's my point exactly. > > with that kind scaling a better ruby version could kill the c one! Did you actually run the 6x6 version? I think my Ruby version might actually be faster than the C one for large squares, since it only computes normalised squares. A reasonable estimate indicates that for 6x6 squares it will take about 23500 seconds on my computer. But I didn't test it, because that's still longer than I am prepared to wait for it :) Kristof