From: Remi Gacogne Date: Tue, 26 May 2026 13:58:49 +0000 (+0200) Subject: dnsdist: Fix the packet cache micro-benchmarks X-Git-Tag: auth-5.1.0~19^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=298afdfbe81ab2bb901ade4457bd17e4e7b97a11;p=thirdparty%2Fpdns.git dnsdist: Fix the packet cache micro-benchmarks Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/bench-dnsdist-cache.cc b/pdns/dnsdistdist/bench-dnsdist-cache.cc index 09f5f59f8a..b3eabf9466 100644 --- a/pdns/dnsdistdist/bench-dnsdist-cache.cc +++ b/pdns/dnsdistdist/bench-dnsdist-cache.cc @@ -88,8 +88,9 @@ TEST_CASE("Cache/Lookup") BENCHMARK(std::to_string(threadsCount)) { + threads.clear(); for (size_t idx = 0U; idx < threadsCount; idx++) { - threads.emplace_back(std::thread(testCode, iterations / threadsCount)); + threads.emplace_back(testCode, iterations / threadsCount); } for (auto& thread : threads) { thread.join(); @@ -133,8 +134,9 @@ TEST_CASE("Cache/Insertion") BENCHMARK(std::to_string(threadsCount)) { + threads.clear(); for (size_t idx = 0U; idx < threadsCount; idx++) { - threads.emplace_back(std::thread(testCode, iterations / threadsCount)); + threads.emplace_back(testCode, iterations / threadsCount); } for (auto& thread : threads) { thread.join();