🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.chess
Article #5189

Speed up Gnuchess

#5189
From: Vincent Diepeveen
Date: Mon, 18 Apr 1994 11:25
53 lines
2104 bytes
Hello,

I discovered in GNU-chess v 4.0 (for dos)
something that can be speeded up( i am sorry for my bad
english ), hopefully i didn't find out the speed-up as second, 
however it is a little speed up, but highly effective in 
Nullmove/Quiescence search, as there will be captured many 
pieces over there.

In UpdatePieceList( .. ) you can see something like

UpdatePieceList( short int sq, short int iop .. ) {
  short int i;
  ..

  if( iop == 1 ) { /* remove a piece from the piecelist */
    ..
    for( i = Pindex[ sq ] ; i < PieceCnt[ side ] ; i++ ) {
      Pindex[ i ] = i;
      PieceList[ side ][ i ] = PieceList[ side ][ i+1 ];
    }
   ...
  }
  else {
  ..
  ..
  }
}

This slow 'shifting up the array PieceList' to fill the hole
PieceList[ side ][ i ] is not practically.
It is easier and faster to say just:

 ..
 if( iop == 1 ) {
   i = Pindex[ sq ];
   if( i < PieceCnt[ side ] ) {
     PieceList[ side ][ i ] = PieceList[ side ][ PieceCnt[ side ] ];
     Pindex[ PieceList[ side ][ i ] ] = i;
   }
   PieceCnt[ side ]--;    
 }
 else {...
 ....

Greetings, Vincent Diepeveen.

email: vdiepeve@cs.ruu.nl
--
                +======================================+
                ||        Groeten, Vincent.           ||
                +--------------------------------------+
                ||  email  : vdiepeve@cs.ruu.nl       ||
Technical Details
Message-ID: <CoGD38.4vp@cs.ruu.nl>
Path: arc1-ca.pugleaf.net!gmd.de!nntp.gmd.de!newsserver.jvnc.net!yale.edu!yale!zip.eecs.umich.edu!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!sun4nl!ruuinf!vdiepeve

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d71d,f47ff393e50f1bce,start
X-Google-Attributes: gid10d71d,public
X-Google-ArrivalTime: 1994-04-18 04:25:55 PST
Newsgroups: gnu.chess
Path: arc1-ca.pugleaf.net!gmd.de!nntp.gmd.de!newsserver.jvnc.net!yale.edu!yale!zip.eecs.umich.edu!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!sun4nl!ruuinf!vdiepeve
From: vdiepeve@cs.ruu.nl (Vincent Diepeveen)
Subject: Speed up Gnuchess
Message-ID: <CoGD38.4vp@cs.ruu.nl>
Summary: vdiepeve@cs.ruu.nl
Keywords: gnu-chess
Sender: usenet@cs.ruu.nl (Six O'Clock News)
Organization: Utrecht University, Dept. of Computer Science
Date: Mon, 18 Apr 1994 11:25:55 GMT
Lines: 53