Sudoku solver

Marko Rauhamaa marko at pacujo.net
Sun Mar 29 14:33:33 EDT 2015


Mark Lawrence <breamoreboy at yahoo.co.uk>:

> One thing I have come to rely on over the years is never, ever trust
> your gut instincts about Python performance, you're almost inevitably
> wrong. When I first came across the Norvig solver I made a change,
> purely for fun, to replace two calls to len() with a single call and
> save the result. The run time to solve each puzzle dropped by around
> 5%. I believe this meets your "conceptually insignificant".

Yes. It's kinda sad when you have to resort to such low-brow
optimizations. Mostly you don't have to, though. You mainly want to keep
the expression elegant.


Marko



More information about the Python-list mailing list