]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix the packet cache micro-benchmarks 17468/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 26 May 2026 13:58:49 +0000 (15:58 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 26 May 2026 13:58:49 +0000 (15:58 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/bench-dnsdist-cache.cc

index 09f5f59f8a42f855858a6312c7df5cfba7d56518..b3eabf94660b6f5eac7405ade0a4df28b8aee35e 100644 (file)
@@ -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();