Computer Chess Club Archives


Search

Terms

Messages

Subject: Would you trade 384 Kbyte of memory for a one percent speed increase?

Author: Steven Edwards

Date: 10:46:55 08/22/03


If you would trade 384 Kbyte of memory for an approximate one percent speed
increase, then read on:

The traditional Zorbrist hash code scheme for accessing transposition tables
uses a table of constant values

     unsigned long long int HashManSqVec[manLen][sqLen];  // or 12 x 64 of eight
byte codes

that is accessed whenever a man is put on a square or removed from a square.
The accesses and the exclusive or operations can be cut in half by adding a
second table of constant values

     unsigned long long int HashManSqSqVec[manLen][sqLen][sqLen];

generated from the first that gives transition hash codes where the second index
is the source square and the third index is the target square.

So, instead of

    theHash ^= HashManSqVec[man][source] ^ HashManSqVec[man][target]

we have

    theHash ^= HashManSqSqVec[man][source][target]

Perhaps someone could install this into Crafty so we could have some independent
performance measurements.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.