Skip to content

Instantly share code, notes, and snippets.

@skybrian
Last active December 20, 2015 21:59
Show Gist options
  • Save skybrian/6201549 to your computer and use it in GitHub Desktop.
Save skybrian/6201549 to your computer and use it in GitHub Desktop.
Performance tests comparing sudoku.py with sudoku.dart
Python
------
$ python sudoku.py
All tests pass.
Solved 95 of 95 hard puzzles (avg 0.02 secs (47 Hz), max 0.10 secs).
Solved 11 of 11 hardest puzzles (avg 0.01 secs (130 Hz), max 0.01 secs).
Solved 99 of 99 random puzzles (avg 0.01 secs (155 Hz), max 0.02 secs).
Macintosh:~/dart/sudoku/bin skybrian
$ python sudoku.py
All tests pass.
Solved 95 of 95 hard puzzles (avg 0.02 secs (47 Hz), max 0.10 secs).
Solved 11 of 11 hardest puzzles (avg 0.01 secs (128 Hz), max 0.01 secs).
Solved 97 of 99 random puzzles (avg 0.01 secs (156 Hz), max 0.01 secs).
Checked mode
------------
All tests pass.
Solved 3 of 3 puzzles (avg 0.06 secs (16 Hz), max 0.129563 secs)
Solved 95 of 95 hard puzzles (avg 0.02 secs (53 Hz), max 0.111003 secs)
Solved 11 of 11 hardest puzzles (avg 0.01 secs (122 Hz), max 0.024414 secs)
Solved 100 of 100 random puzzles (avg 0.01 secs (176 Hz), max 0.005931 secs)
All tests pass.
Solved 3 of 3 puzzles (avg 0.06 secs (16 Hz), max 0.13017 secs)
Solved 95 of 95 hard puzzles (avg 0.02 secs (53 Hz), max 0.112449 secs)
Solved 11 of 11 hardest puzzles (avg 0.01 secs (121 Hz), max 0.024671 secs)
Solved 100 of 100 random puzzles (avg 0.01 secs (174 Hz), max 0.006288 secs)
Unchecked mode
--------------
All tests pass.
Solved 3 of 3 puzzles (avg 0.05 secs (20 Hz), max 0.082397 secs)
Solved 95 of 95 hard puzzles (avg 0.01 secs (89 Hz), max 0.062395 secs)
Solved 11 of 11 hardest puzzles (avg 0.00 secs (209 Hz), max 0.014455 secs)
Solved 100 of 100 random puzzles (avg 0.00 secs (292 Hz), max 0.003704 secs)
All tests pass.
Solved 3 of 3 puzzles (avg 0.05 secs (20 Hz), max 0.081845 secs)
Solved 95 of 95 hard puzzles (avg 0.01 secs (89 Hz), max 0.061552 secs)
Solved 11 of 11 hardest puzzles (avg 0.00 secs (205 Hz), max 0.014823 secs)
Solved 100 of 100 random puzzles (avg 0.00 secs (293 Hz), max 0.00357 secs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment