From e9b77454c36bfdf7d8cffb4e98121fe24b6502d3 Mon Sep 17 00:00:00 2001 From: Karl Kfoury <76066593+KarlKfoury@users.noreply.github.com> Date: Sat, 31 Aug 2024 16:58:42 +0300 Subject: [PATCH] calculating database probing time and logging a message if time > 1s adressing issue #1768 --- src/syzygy/syzygy.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/syzygy/syzygy.cc b/src/syzygy/syzygy.cc index 115164b772..9c2370989c 100644 --- a/src/syzygy/syzygy.cc +++ b/src/syzygy/syzygy.cc @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -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 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(w[0]) - 2;