]> git.sesse.net Git - stockfish/commitdiff
Reduce writes in TT::probe().
authormstembera <MissingEmail@email>
Tue, 15 Sep 2015 20:28:42 +0000 (13:28 -0700)
committerJoona Kiiski <joona@zoox.com>
Fri, 18 Sep 2015 00:33:40 +0000 (17:33 -0700)
Only refresh TT entry when it's really necessary.
This should give a small speed boost for some machines.
And it's a risk-free change.

No functional change.

Resolves #429

src/tt.cpp

index f9674601373319bdd32003429d000a8dc99ac448..0c77d6b2abc7f53e92abda330b2dc238e38fa425 100644 (file)
@@ -78,7 +78,7 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
   for (int i = 0; i < ClusterSize; ++i)
       if (!tte[i].key16 || tte[i].key16 == key16)
       {
   for (int i = 0; i < ClusterSize; ++i)
       if (!tte[i].key16 || tte[i].key16 == key16)
       {
-          if (tte[i].key16)
+          if ((tte[i].genBound8 & 0xFC) != generation8 && tte[i].key16)
               tte[i].genBound8 = uint8_t(generation8 | tte[i].bound()); // Refresh
 
           return found = (bool)tte[i].key16, &tte[i];
               tte[i].genBound8 = uint8_t(generation8 | tte[i].bound()); // Refresh
 
           return found = (bool)tte[i].key16, &tte[i];