Well, I measured the average number of CPU cycles for my evaluation function and a TT probe with 2 different TT sizes, one of 1 MB. and one of 1024 MB.
The TT uses 16 byte entry's and 4 buckets per key.
I used a 7 ply search on the 1500 positions from STS and averaged the result.
Before loading each position the pawn-table and TT are cleared.
These results are for a Haswell processor with 4 channel DDR 4.
It is possible that probing the TT on an AMD or older Intel processor will tell a different story.
hgm wrote:Well, if the eval takes that long my guess is that it would indeed be better to first probe TT.
It is on my todo list to check what performs best.
Unfortunately it is a bit difficult to change it in an elegant way.
I have to hack it in, and that is something I don't like.
It has everything to do with researching a position and not wanting to call the evaluation function several times in a row for the same position.
I can use a flag (very ugly) or add an evaluation cache to avoid this problem.
Another option is to probe the TT right after the do-move, in that case I have to change the layout of the search somewhat.
I never noticed that. I always start calculating the hash key, to use it for repetition detection. If the move is a repetition, then making it is a waste of time. (And probing the TT would also be a waste of time.)
Normally the hash-key update only requires the from-square, to-square, and what is on them, which can be known from the current position. No reason to change anything on the board or in the piece list. Special moves are flagged in the move list, (I usually use an invalid to-square for those), so they are easily detected, and cause a move-type-dependent modification of the normal key (which you could or instance tabulate as a function of the signalling to-square value).
True, you can calculate the hash and probe the TT before doing the move.
It will make the search less structured though.
Moving the hash calculation out of the do-move will probably cost you some extra cycles as well.
I doubt that you will gain much, only in case of a TT hit there is a redundant do-move undo-move pair that wastes some time.