From: Andrew Johnson Date: 2004-12-10T04:47:28+09:00 Subject: Re: [SUMMARY] Crosswords (#10) On Thu, 9 Dec 2004 23:55:37 +0900, Brian Schr�der wrote: > Hello James, > > Nice summary, thanks you again. Did you benchmark the solutions, I would be > interested in how fast/slow some approaches where. Especially those that rely > heavily on string manipulation, vs. those that build up the layout in a > streaming fashion. Out of interest, I downloaded the zipfile of solutions from the Quiz site: http://www.grayproductions.net/ruby_quiz/quiz10_sols.zip and modified the 10 solutions to iterate over ARGV 25.times generating puzzles for each file in the argument list. Each was called as: time ruby crossword.rb ../../files/* > OUT where ../../files contained the following layouts (from the zipfile): big_layout.txt size => 15x15 ruby-quiz.layout size => 18x15 simple_layout.txt size => 7x6 and ruby is ruby 1.8.2 (2004-07-20) [i686-linux] with oniguruma. The results tabulate as follows (this is not a speedy machine): real user sys Markus_Koenig 3.028 3.000 0.030 Andrew_Johnson 4.062 4.040 0.020 T._Onoma 5.175 5.130 0.040 James_Edward_Gray_II 5.674 5.590 0.080 Jim_Menard 6.485 6.450 0.040 Brian_Schroeder 7.425 7.210 0.040 Jamis_Buck 8.378 8.350 0.030 Jim_Freeze 11.989 11.970 0.020 Pit_Capitain 13.949 13.910 0.040 Clark 15.304 15.270 0.030 Note: speed was in no way a criteria/goal of the exercise, and this is only a *very* rudimentary benchmark --- large grids (100x100), or grids with more (or less) complicated fill patterns may very well alter the ordering significantly. Any attempts to derive meaning from these results will be met with a withering stare and quite possibly a rolling of the eyes. You have been warned. regards, andrew