forked from official-stockfish/Stockfish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defer hash table resize and avoid redundant clears
Defer hash table resize until the hash is actually needed. That is, either when 'isready' or a search start command is received. This has the following benefits: - Stockfish initializes faster, especially on big hash sizes, since setting 'Threads' and 'Hash' will now trigger only 1 hash resize. Further, this removes the speed difference related to the order of setting "Hash" and "Threads". - The initial default hash is never allocated in case the user sets the hash table size. Add also tracking for whether the hash is dirty to avoid redundant clears. This speeds up the initialization further. With these improvements, Stockfish initialization is improved drastically in the TCEC "Blue" machine: (176 threads, 128 GB hash) Case Init sequence style (SF ver) Process launch to search start =================================================================== (1) Default Cutechess (SF-dev) 59.0641s (2) TCEC Cutechess-cli (SF-dev) 8.980s (3) Either (SF-dev + this patch) 4.853s The init sequence used in testing is as follows: (Default Cutechess style) uci setoption name Hash value 131072 setoption name Threads value 176 setoption name OwnBook value false setoption name Ponder value false ucinewgame isready position startpos isready go depth 1 The TCEC-patched Cutechess sets "Threads" before "Hash", since this order is much faster on many engines, including SF-dev before this patch. Similarly, many regular users will also encounter speedups. The above init sequence on my box measures the following times for the different cases: (Intel Core i7-8700k, 12 threads, 16 GB hash) (1) 2.347s (2) 1.430s (3) 0.975s This patch makes my chess GUI (chessx) also start the analysis noticeably faster. Response time improves from approx 2s to 1s from pressing 'Analyze' to first output. (Same i7-8700k, 11 threads, 16 GB hash) No functional change
- Loading branch information
Showing
5 changed files
with
48 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters