aboutsummaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-07-22 11:06:57 +0000
committerSimon Tatham <anakin@pobox.com>2005-07-22 11:06:57 +0000
commita605a17d05acf4d981219c5e8db3def0b67a5c4a (patch)
tree9153cfc0f194159faf4d2dd050a5eb935971ecc2 /pattern.c
parent6bce285027a9eacd50b92b5a26e1cd3c5c69a4ca (diff)
downloadpuzzles-a605a17d05acf4d981219c5e8db3def0b67a5c4a.zip
puzzles-a605a17d05acf4d981219c5e8db3def0b67a5c4a.tar.gz
puzzles-a605a17d05acf4d981219c5e8db3def0b67a5c4a.tar.bz2
puzzles-a605a17d05acf4d981219c5e8db3def0b67a5c4a.tar.xz
James H profiled the new Same Game grid generator and discovered it
was spending 60% of its time in shuffle(). The purpose of the shuffle() call was to go through a largish array in random order until we found an element that worked, so there's no actual need to shuffle the whole array every time and I only did it out of laziness. So I now pick a random element each time I go round the loop, meaning I save a lot of shuffling effort whenever the loop terminates early (which is often). I get about a factor of two speed improvement from this small change. [originally from svn r6125]
Diffstat (limited to 'pattern.c')
0 files changed, 0 insertions, 0 deletions