mcostalba/Stockfish — pull request #170 by Thanar2 (2014-02-15 19:36:23+00:00)
Title: Speed up TT store by checking for matches first

Pure speed improvement to TranspositionTable::store(). The new code first checks all four TTEntry slots in a cluster for an empty or matching one, avoiding the "replace strategy" code completely in cases where an empty or matching one is found. The loop is unrolled to the constant ClusterSize of 4 for a measurable speed improvement.

The loop that implements the replace strategy only needs to execute 3 times instead of the original 4. Since in the old version, replace and tte started off pointing to the same slot which did nothing in the first iteration.

Standard bench shows approximately 1.4% speed improvement on my machine. A local test of 10,000 games at 10 second time control gave the following results: 1942-1816-6242 [.506].

No functional change.