]> git.sesse.net Git - stockfish/commitdiff
Do not sort negative non captures at low depth
authorMarco Costalba <mcostalba@gmail.com>
Sat, 4 Jun 2011 05:25:16 +0000 (06:25 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 4 Jun 2011 05:35:24 +0000 (06:35 +0100)
Speedup of the whole 3 patch series is of 2,5% !!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movepick.cpp
src/movepick.h

index 8f3f65b165d2c8d65031aecf6046001623a54f92..61e5527f42c61d638132201f0b2f2efd18bc999a 100644 (file)
@@ -56,7 +56,7 @@ namespace {
 /// move ordering is at the current node.
 
 MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
-                       SearchStack* ss, Value beta) : pos(p), H(h) {
+                       SearchStack* ss, Value beta) : pos(p), H(h), depth(d) {
   captureThreshold = 0;
   badCaptures = moves + MAX_MOVES;
 
@@ -162,7 +162,8 @@ void MovePicker::go_next_phase() {
   case PH_NONCAPTURES_2:
       curMove = lastMove;
       lastMove = lastNonCapture;
-      insertion_sort<MoveStack>(curMove, lastMove);
+      if (depth >= 3 * ONE_PLY)
+          insertion_sort<MoveStack>(curMove, lastMove);
       return;
 
   case PH_BAD_CAPTURES:
index c4d665a93a3cb34eb95a679e14fd5b084021dd5b..d0ced0474ffd901e6b34275acf520147001fe506 100644 (file)
@@ -53,6 +53,7 @@ private:
 
   const Position& pos;
   const History& H;
+  Depth depth;
   Move ttMove;
   MoveStack killers[2];
   int captureThreshold, phase;