]> git.sesse.net Git - stockfish/commit - src/tt.cpp
Explicitly zero TT upon resize.
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 1 Jan 2018 09:10:41 +0000 (10:10 +0100)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Mon, 1 Jan 2018 12:17:51 +0000 (13:17 +0100)
commit2ba47416cbdd5db2c7c79257072cd8675b61721f
treeac21bcf2a6bef6e2e54afda14b0e016c85238864
parent7d4d3a2c3a4c6ce96bdbcfecf373934fdccc9b07
Explicitly zero TT upon resize.

as discussed in issue #1349, the way pages are allocated with calloc might imply some overhead on first write.
This overhead can be large and slow down the first search after a TT resize significantly, especially for large TT.
Using an explicit clear of the TT on resize fixes this problem.

Not implemented, but possibly useful for large TT, is to do this zero-ing using all search threads. Not only would this be faster, it could also lead to a more favorable memory allocation on numa systems with a first touch policy.

No functional change.
src/tt.cpp