From 780816a2ec918ffa2c8c3fd9cb5c52856bf7543f Mon Sep 17 00:00:00 2001 From: JCW Date: Fri, 30 May 2025 10:31:35 +0100 Subject: [PATCH] Fix build errors --- include/xrpl/beast/hash/xxhasher.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 3da0639051..62b008746c 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -182,6 +182,9 @@ public: { if (readBuffer_.size() == 0) return 0; + auto start = std::chrono::steady_clock::now(); + auto cpuCyclesStart = __rdtsc(); + std::array hash{}; const size_t bit_width = readBuffer_.size() * 8; const size_t shift = seed_ % bit_width; @@ -208,6 +211,17 @@ public: std::uint64_t result; std::memcpy(&result, hash.data(), hash.size()); + + duration_ += std::chrono::steady_clock::now() - start; + cpuCycles += (__rdtsc() - cpuCyclesStart); + + std::lock_guard lock{FunctionProfiler::mutex_}; + FunctionProfiler::funcionDurations + ["xxhasher-" + std::to_string(totalSize_)] + .time.emplace_back(duration_); + FunctionProfiler::funcionDurations + ["xxhasher-" + std::to_string(totalSize_)] + .cpuCycles.emplace_back(cpuCycles); return result; // auto start = std::chrono::steady_clock::now(); // // auto ret = XXH3_64bits_digest(state_);