From: Jörg Oster Date: Sun, 30 Jun 2019 13:16:20 +0000 (+0200) Subject: Try to get a more precise bench time (#2211) X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=c9d73d1aa5cf609b626776a112cd699339fefb67;hp=d889bb47185e33012b45cab63359952247bc86e2 Try to get a more precise bench time (#2211) Initialization of larger hash sizes can take some time. Don't include this time in the bench by resetting the timer after Search::clear(). Also move 'ucinewgame' command down in the list, so that it is processed after the configuration of Threads and Hash size. No functional change. --- diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 51bd7949..b23c5d17 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -139,9 +139,9 @@ vector setup_bench(const Position& current, istream& is) { file.close(); } - list.emplace_back("ucinewgame"); list.emplace_back("setoption name Threads value " + threads); list.emplace_back("setoption name Hash value " + ttSize); + list.emplace_back("ucinewgame"); for (const string& fen : fens) if (fen.find("setoption") != string::npos) diff --git a/src/uci.cpp b/src/uci.cpp index 739cf343..a4235f2b 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -164,7 +164,7 @@ namespace { } else if (token == "setoption") setoption(is); else if (token == "position") position(pos, is, states); - else if (token == "ucinewgame") Search::clear(); + else if (token == "ucinewgame") { Search::clear(); elapsed = now(); } // Search::clear() may take some while } elapsed = now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero'