From: "trans. (T. Onoma)" Date: 2004-12-10T01:18:52+09:00 Subject: Re: [SUMMARY] Crosswords (#10) --Boundary-00=_nrHuBQplrBN2eUD Content-Type: Multipart/Mixed; boundary="Boundary-00=_nrHuBQplrBN2eUD" --Boundary-00=_nrHuBQplrBN2eUD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 09 December 2004 10:52 am, Brian Schr=C3=B6der wrote: | Well, you're right. I can't imagine anybody wants to solve a crossword of | the size whose layout would take noteworthy time to calculate. I only got | the feeling that all this transpose, gsub, etc... stuff should take a lot | of time. On the other hand ruby performance is nearly always different fr= om | what I expect. I don't expect mine to be anywhere near "fast" considering the approach I=20 took. But just for the sake of inquiry I put a quick benchmark together.=20 Should be trivial for others to fill in with their own. (see attached) My Results: Tom's Solution 1000 runs: user system total real Default Layout: 3.390000 0.210000 3.600000 ( 3.716914) Jim's Layout: 21.490000 1.470000 22.960000 ( 23.339115) Of course this will very from machine to machine. Perhaps this will make it easier to throw together some comparison benchmar= ks? T. --Boundary-00=_nrHuBQplrBN2eUD Content-Type: application/x-ruby; name="benchit.rb" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="benchit.rb" require 'benchmark' load('crossit.rb') # my program # do each this many times $n = 1000 $layout1 = <