Sudoku solver

BartC bc at freeuk.com
Sat Mar 28 19:50:03 EDT 2015


On 28/03/2015 03:39, Sayth wrote:
> Good test for pypy to see where it's speed sits between C and Python.

I've spent the last hour or so doing such tests.

Using the OP's algorithm, and testing with the 'hard' puzzle posted by 
Ian Kelly, I got these approximate results:

Python 3.1:     1700 seconds     (normal Python interpreter)
PyPy:           93 seconds
C unoptimised:  17 seconds       (gcc -O0 32-bit)
C optimised:    3.3 seconds      (gcc -O3 32-bit)
(X:             170 seconds)

All running on Windows on x64.

(X is my own interpreted language, which is where my interest in this 
is. This had been generally faster than Python until PyPy came along. It 
does however use a pure byte-code interpreter, so the result is not too bad.

But using X *and* my own brute-force algorithm, the same puzzle took 2 
seconds to solve - faster than C!

However it doesn't matter that the OP's algorithm is not great, as it 
makes an interesting new benchmark.)

-- 
Bartc



More information about the Python-list mailing list