mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
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.
This commit is contained in:
parent
d889bb4718
commit
c9d73d1aa5
2 changed files with 2 additions and 2 deletions
|
@ -139,9 +139,9 @@ vector<string> setup_bench(const Position& current, istream& is) {
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
list.emplace_back("ucinewgame");
|
|
||||||
list.emplace_back("setoption name Threads value " + threads);
|
list.emplace_back("setoption name Threads value " + threads);
|
||||||
list.emplace_back("setoption name Hash value " + ttSize);
|
list.emplace_back("setoption name Hash value " + ttSize);
|
||||||
|
list.emplace_back("ucinewgame");
|
||||||
|
|
||||||
for (const string& fen : fens)
|
for (const string& fen : fens)
|
||||||
if (fen.find("setoption") != string::npos)
|
if (fen.find("setoption") != string::npos)
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace {
|
||||||
}
|
}
|
||||||
else if (token == "setoption") setoption(is);
|
else if (token == "setoption") setoption(is);
|
||||||
else if (token == "position") position(pos, is, states);
|
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'
|
elapsed = now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero'
|
||||||
|
|
Loading…
Add table
Reference in a new issue