joshbduncan / word-search-generator

Make awesome Word Search puzzles!
MIT License
74 stars 24 forks source link

Need for speed #37

Closed joshbduncan closed 1 year ago

joshbduncan commented 1 year ago

@duck57, I just did some refactoring on the puzzle generation code to speed things up (especially on larger puzzles and puzzles with large word counts). After doing some profiling on what was slow and making changes, I was able to increase speed by 32% percent on non-masked puzzles and 48% on masked puzzles. I thought this may be useful for your crossword generator.

joshbduncan commented 1 year ago

@duck57, I got the speed increase up to 53% faster on non-masked puzzles and 58% on masked puzzles. I'm sure there are more places I could optimize but I think this is good enough for now. Cheers!

duck57 commented 1 year ago

Good work finding those slow spots; I would not have thought of some of those changes.