]> git.sesse.net Git - stockfish/commitdiff
QuietPick Speed-up
authorVoyagerOne <excelgeek@gmail.com>
Mon, 17 Jun 2019 21:35:03 +0000 (17:35 -0400)
committerStephane Nicolet <cassio@free.fr>
Thu, 20 Jun 2019 14:22:45 +0000 (16:22 +0200)
Non-functional speedup: no need to generate, score, or sort quiet moves
if SkipQuiet is true. Thanks to @mstembera for his suggestion.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 27910 W: 6406 L: 6129 D: 15375
http://tests.stockfishchess.org/tests/view/5d07e0920ebc5925cf0a58a8

Closes https://github.com/official-stockfish/Stockfish/pull/2194

No functional change

src/movepick.cpp

index a70785e769710bcd81ce704ca74bec8cadf03607..52ac5b4cd416ead4457379801e2e3e5a5ff1a5bc 100644 (file)
@@ -200,11 +200,15 @@ top:
       /* fallthrough */
 
   case QUIET_INIT:
-      cur = endBadCaptures;
-      endMoves = generate<QUIETS>(pos, cur);
+      if (!skipQuiets)
+      {
+          cur = endBadCaptures;
+          endMoves = generate<QUIETS>(pos, cur);
 
-      score<QUIETS>();
-      partial_insertion_sort(cur, endMoves, -4000 * depth / ONE_PLY);
+          score<QUIETS>();
+          partial_insertion_sort(cur, endMoves, -4000 * depth / ONE_PLY);
+      }
+      
       ++stage;
       /* fallthrough */