Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: piece list possibilities

Author: Dan Newman

Date: 11:58:25 07/08/98

Go up one level in this thread


On July 08, 1998 at 12:40:15, Tom Kerrigan wrote:

>On July 08, 1998 at 03:51:14, Dan Newman wrote:
>
>>I actually don't shorten the piece list in most of the other chess
>>programs I've written--to do so only makes the program a little
>>faster.  But I thought I'd do it on my latest, just to squeeze out
>>that extra few percent.
>
>Maybe...
>
>I wouldn't be surprised if the difference is 10-30%, depending on the situation.
>Almost every part of Stobor tests the captured flags of several pieces.
>It seems like an annoying waste of compute power to me, and it certainly isn't
>doing anything to make the code legible.
>
>Cheers,
>Tom

You may well be right.  In the past when I've measured this, I only
measured it in the move generator, and IIRC, the hit on the move
generator *was* something like 30% (for KPK say) which translated
to about a 3% hit on the chess engine, but now I'm also running
through the piece lists for attack detection (using coordinate
difference tables allowed by 0x88) and maybe other stuff later.
So it could eat a lot more cycles than I'd thought.

I have tried doubly linked piece lists in the past (especially
for heavy weight piece structs).  You just disconnect the piece
when it's captured (lots of moving pointers about) and stuff a
pointer to it onto a stack.  When you undo the move, the piece
still has its linked list pointers set, so it knows where it
belongs in the piece list--very easy to put it back in the
same place.  The biggest hit I suppose is in make() and undo()
where all that pointer copying is done.

-Dan.



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