Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: hash table size - is a power of 2 still an advantage these days?

Author: Robert Hyatt

Date: 08:49:58 09/24/03

Go up one level in this thread


On September 24, 2003 at 11:20:13, William Penn wrote:

>For example, is 512MB hash table size really better than 513MB (512+1), or
>better than 528MB (512+16)?
>
>Another example, is 768MB (3x256) better than 784MB (3x256+16)?
>
>I'm also wondering if these old rules (truisms) regarding optimum numbers for
>hash table size only apply to the Windows 9x/Me op systems which had problems
>with allocation of resources? I'm doubtful that they still apply to 2000/XP op
>systems.
>
>Does anyone really know?

The point is a bit of speed.   You have to convert a hash signature into a
hash table index.  For a tablesize that is a power of 2, you can simply
AND (mask) off the upper bits leaving a power-of-2 table index.  For other
sizes, you will end up doing a divide (mod) to get the remainder.  The divide
is not fast.

How significant this is is debatable, but for some of us, "every cycle counts."


>
>I'm not interested in old truisms, or hand-me-down story tales, or second had
>advice. I mean... Does anyone who writes this kind of code know whether it
>really makes a difference anymore exactly what hash table size is allocated?
>
>My only knowledge here is that I once wrote some code to proofread chess game
>scores, requiring me to define legal chess moves. There was some advantage to
>indirect addressing of memory, it used a cycle less per instruction, if it was a
>particular bank size such as exactly 256 bytes (or whatever), i.e. a power of 2.
>But that was with the old Commodore 64's processor, and I don't know how the
>current processor instruction sets work.
>
>Thanks,
>WP



This page took 0.02 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.