From 8647fbd6ed11c60282e84e4b486a7e8258c88483 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 4 Jun 2011 06:25:16 +0100 Subject: [PATCH 1/1] Do not sort negative non captures at low depth Speedup of the whole 3 patch series is of 2,5% !! Signed-off-by: Marco Costalba --- src/movepick.cpp | 5 +++-- src/movepick.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index 8f3f65b1..61e5527f 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -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(curMove, lastMove); + if (depth >= 3 * ONE_PLY) + insertion_sort(curMove, lastMove); return; case PH_BAD_CAPTURES: diff --git a/src/movepick.h b/src/movepick.h index c4d665a9..d0ced047 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -53,6 +53,7 @@ private: const Position& pos; const History& H; + Depth depth; Move ttMove; MoveStack killers[2]; int captureThreshold, phase; -- 2.39.2