Skip to content

Commit

Permalink
* src/main/clojure/clojure/core/logic/bench.clj: add Norvig hardest. …
Browse files Browse the repository at this point in the history
…Add hard one from GeCode test suite.
  • Loading branch information
David Nolen authored and David Nolen committed Aug 1, 2012
1 parent 88e3c7d commit 5db26ee
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/main/clojure/clojure/core/logic/bench.clj
Expand Up @@ -517,12 +517,13 @@
(sudokufd easy0)

;; ~600ms
;; 6ms solve easy
;; 6ms for 1
(dotimes [_ 5]
(time
(dotimes [_ 100]
(sudokufd easy0))))

;; Hardest Norvig Random
(def hard0
[0 0 0 0 0 6 0 0 0
0 5 9 0 0 0 0 0 8
Expand All @@ -539,8 +540,32 @@
(time (sudokufd hard0))

;; ~600ms
;; ~60ms for 1
(dotimes [_ 5]
(time
(dotimes [_ 10]
(sudokufd hard0))))

;; from GeCode test suite
(def hard1
[0 0 0 0 0 3 0 6 0
0 0 0 0 0 0 0 1 0
0 9 7 5 0 0 0 8 0

0 0 0 0 9 0 2 0 0
0 0 8 0 7 0 4 0 0
0 0 3 0 6 0 0 0 0

0 1 0 0 0 2 8 9 0
0 4 0 0 0 0 0 0 0
0 5 0 1 0 0 0 0 0])

(time (sudokufd hard1))

;; ~1500ms
;; ~150ms for 1
(dotimes [_ 5]
(time
(dotimes [_ 10]
(sudokufd hard1))))
)

0 comments on commit 5db26ee

Please sign in to comment.