Skip to content

Commit

Permalink
calculating database probing time and logging a message if time > 1s
Browse files Browse the repository at this point in the history
adressing issue LeelaChessZero#1768
  • Loading branch information
KarlKfoury authored Aug 31, 2024
1 parent d298c04 commit e9b7745
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/syzygy/syzygy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <atomic>
#include <cstdint>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
Expand Down Expand Up @@ -1407,7 +1408,13 @@ class SyzygyTablebaseImpl {
idx = type != DTM ? encode_pawn_f(p, ei, be) : encode_pawn_r(p, ei, be);
}

auto start = std::chrono::high_resolution_clock::now();
uint8_t* w = decompress_pairs(ei->precomp, idx);
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> duration = end - start;
if (duration.count() > 1) {
std::cout << "Warning: Computation took " << elapsed.count() << " seconds, which is longer than expected." << std::endl;
}

if (type == WDL) return static_cast<int>(w[0]) - 2;

Expand Down

0 comments on commit e9b7745

Please sign in to comment.