From: Jim Menard Date: 2004-12-10T01:36:04+09:00 Subject: Re: [SUMMARY] Crosswords (#10) trans. (T. Onoma) wrote: > On Thursday 09 December 2004 10:52 am, Brian Schr�der 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 from > | what I expect. > > I don't expect mine to be anywhere near "fast" considering the approach I > took. But just for the sake of inquiry I put a quick benchmark together. > 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) Ouch. Of course, I don't plan to generate 1,000 crossword puzzles any time soon. I focused on elegant code, not needless optimizations :-) Jim -- Jim Menard, jimm@io.com, http://www.io.com/~jimm