Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to make your movegen 4x slower in 1 easy step

Author: Dieter Buerssner

Date: 12:14:59 08/30/01

Go up one level in this thread


On August 30, 2001 at 13:56:53, Scott Gasch wrote:

>I'm moving around data structures in my engine to consolodate things that are
>going to be needed on a per-cpu basis if/when I go parallel.
>
>One such structure is my move stack.  It's a big array of moves with a start and
>end index per ply.  So for example it might look like this:
>
>start[0] = 0  ...  end[0] = 32  [array entries 0..32 hold moves at ply 0]
>start[1] = 33 ...  end[1] = 60  [array entries 33..60 hold moves at ply 1]
>...

I guess, you are aware, that you can save half of the data-space for this,
because end[n] is always equal start[n+1]-1. So, only have a start array of
indices (or perhaps pointers may save a very few CPU-cycles), is enough. It will
not only save the data space, but also the additional memory accesses.

>Well if more than one thread is searching at once I will need more than one move
>stack and more than one ply counter.  So I kept the same move stack struct and
>made g_MoveStack an array:
>
>MOVE_STACK g_MoveStack[NUM_CPU];

Do you also get the factor of 4, when you define NUM_CPU as 1?

It might be because of caching, and where the data resides. I have seen speedups
of over 10% in Yace by *adding* a new data structure for debugging. And also
slowdowns in the same order of magnitude. I have not investigated, where this
comes from, but when this would be in the move-generator, it could translate to
a factor of 4.

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.