Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Alpha Beta routine parameters

Author: Bruce Moreland

Date: 09:40:01 11/07/98

Go up one level in this thread



On November 07, 1998 at 10:56:32, Steve Maughan wrote:

>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?

Or, you can pass a pointer to the record, which means that you don't have to
index it.

Best way to determine if it's faster is to try it.

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.