Computer Chess Club Archives


Search

Terms

Messages

Subject: Alpha Beta routine parameters

Author: Steve Maughan

Date: 07:56:32 11/07/98


I know that some compilers will try to avoid setting up a memory stack and, if
possible, use the registers to pass parameters to procedures.  This has speed
advanatges since the memory allocation for the stack is a costly routine.

What does this have to do with Chess you might ask?  Well, since the main
procedure in virtually all programs is a call to some form of Alpha Beta search
eg

function AlphaBeta(Alpha, Beta, Depth, StaticScore, CastleEP_Flags,
NullMove_Last etc...)

It is tempting to use a declaration, as above, passing all kind of info to the
routine.  There is, of course, another way whereby the parameters are held in
global arrays and referenced by the Depth of the search.  This would mean that
the routine declaration would become;

function AlphaBeta(depth : integer) : integer;

Alpha would then by Parameters[Depth].Alpha.  This has the disadvantage that all
parameters are referenced as a lookup, but even this is minimised by holding the
parameters in a record.

Does anyone know which of the two structures is faster in practice?  If one is
faster, how much faster is it?

Hope this makes sense.

Thanks

Steve Maughan




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.