Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Why hash tables? Where do programs spend the majority of the CPU time?

Author: Bruce Moreland

Date: 15:50:20 09/16/98

Go up one level in this thread



On September 16, 1998 at 18:16:31, John Coffey wrote:

>Do programs use hash tables become they spend more time evaluating
>the positions at the leaves than they do traversing the tree?
>
>How much overhead (CPU wise) do hash tables take?
>
>It seems to me that in the endgame you could have the same positions
>arise multiple times, but in the middle game it would be rare.  Has
>anyone done any tests on this?

I think that when people think of hash tables, they think of eliminating
sub-trees that have already happened.  But what happens more often is that the
hash element doesn't let you cut off, but rather gives you a clue as to which of
the legal moves in this position to search first.  Knowing which move to search
first is an advantage.  Sometimes this lets you cut off with less work, and
other times it gives you a higher initial score so the rest of the moves take
less time to search.

It takes a few percent of program execution to compute keys and do probes and
stores, but of course people have tested them.  In a large majority of the
cases, the decreased tree size will more than make up for the slightly increased
CPU usage.

bruce




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.