Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: hash entry replacement schemes

Author: Dieter Buerssner

Date: 11:28:24 09/15/02

Go up one level in this thread


On September 15, 2002 at 04:32:48, martin fierz wrote:

>On September 14, 2002 at 20:24:11, scott farrell wrote:
>>How to you calculate the index for the second probe.
>
>index++;  :-)

Perhaps, it is the same I am doing, perhaps it is different. I use 3 probes. So,
make sure, the number_of_entries is a multiple of 3. The first index then is
index = hashkey(I use one 32 bit half of it)%(number_of_entries/3). Of course
the division by three, will only be done once, when initializing or resizing the
HTs. BTW. If you unroll the n probes, on x86 platform using index, index+1 and
index+2 may yield in slightly more efficient code, than the index++. Similar if
you use pointers HASHENTRY *hp = hash_mem + hash_key%size_div_by three.
Accessing hp[0], hp[1] and hp[2] may be faster, than issuing a hp++ in between,
because (depending on the size of an entry) the x86 adressing modes may handle
the offset directly in the instruction.

Regards,
Dieter



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.