]> git.sesse.net Git - stockfish/commit
Skip evaluate() call after a null move
authorMarco Costalba <mcostalba@gmail.com>
Sun, 4 Nov 2012 09:21:40 +0000 (10:21 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 4 Nov 2012 09:48:14 +0000 (10:48 +0100)
commit37e9802411fa122eb140ada2edfc9df3be55dbb8
tree08a9ff3d69926dcf202c95c3796fb3f6c77522bd
parenta87831230d72b8f849acdef011cee8c835bcf9db
Skip evaluate() call after a null move

Reuse the evaluation of the parent with inverted sign and
set margin to zero (this is an hack!).

This is done only in qsearch where almost 15% of calls are
from a null move. In normal search the number of nodes where

(ss-1)->currentMove == MOVE_NULL

is almost zero and so there is no need of using this trick.

The big advantage of this patch is a speed-up due to skipped
evaluate() calls, that are very costly.

Functionality is of course affected and we will need to proper
test it later. For now we just register a 3-4% speed up.

Suggested by Hongzhi Cheng.

bench: 5051328
src/search.cpp