Skip to content

Commit

Permalink
Added prefetch to improve transposition table performance - #32
Browse files Browse the repository at this point in the history
Added prefetch to improve transposition table performance

STC:
ELO   | 26.78 +- 11.28 (95%)
SPRT  | 10.0+0.10s Threads=1 Hash=16MB
LLR   | 2.97 (-2.94, 2.94) [0.00, 5.00]
GAMES | N: 1976 W: 610 L: 458 D: 908

Bench: 3364651
  • Loading branch information
SzilBalazs authored Jul 28, 2023
2 parents 63d8719 + 99cd7e7 commit 80ae664
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/search/search_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ namespace search {
board.make_move(move, &nnue);
Score score;

shared.tt.prefetch(board.get_hash());

if (!in_check && depth >= 3 && made_moves >= 4 && !move.is_promo() && move.is_quiet()) {
Depth R = lmr_reductions[depth][made_moves];

Expand Down
4 changes: 4 additions & 0 deletions src/search/tt.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ namespace search {
}
}

void prefetch(U64 hash) {
__builtin_prefetch(get_entry(hash), 0);
}

core::Move get_hash_move(U64 hash) {
TTEntry *entry = get_entry(hash);
if (entry->hash == hash)
Expand Down

0 comments on commit 80ae664

Please sign in to comment.