SEE algorithm on chessprogramming wiki

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28386
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SEE algorithm on chessprogramming wiki

Post by hgm »

bob wrote:A recursive implementation depends on procedure calls and returns, which is less efficient because of the call instruction in X86. An iterative approach (which I have always used) avoids this overhead completely. I have tried this recursive approach, just for fun, but there is a small speed penalty. But since this gets executed so frequently, it has a measurable impact on overall speed.
OK, but that procedure calling involves overhead is well known. The issue here if it would pay to implement apha-beta fully. Be it recursively or iteratively. My post that you quoted showed the iterative version of the fully implemented alpha-beta.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: SEE algorithm on chessprogramming wiki

Post by bob »

hgm wrote:
bob wrote:A recursive implementation depends on procedure calls and returns, which is less efficient because of the call instruction in X86. An iterative approach (which I have always used) avoids this overhead completely. I have tried this recursive approach, just for fun, but there is a small speed penalty. But since this gets executed so frequently, it has a measurable impact on overall speed.
OK, but that procedure calling involves overhead is well known. The issue here if it would pay to implement apha-beta fully. Be it recursively or iteratively. My post that you quoted showed the iterative version of the fully implemented alpha-beta.
I would never argue with that point. My alpha/beta search in Cray Blitz was fully iterative since when it was started, FORTRAN didn't support recursion at all. (they used a fixed static area to store registers which included the return address so recursion would introduce an instant infinite loop). I like the look of the recursive SEE, but not the speed.