From 468b232f71562280aae16876bc257ec24f5fcccb Mon Sep 17 00:00:00 2001 From: Martin Ankerl Date: Fri, 17 Sep 2021 13:38:11 +0200 Subject: [PATCH] bench: remove unnecessary & incorrect multiplication in MuHashDiv Introduced in #19055, MuHashDiv benchmark used to multiply with a loop based on epochIterations. That does not do what it is supposed to do, because epochIterations() is determined automatically from nanobench. Also, multiplication is not needed for the algorithm (as pointed out by a comment in #19055), so it's better to remove this loop. --- src/bench/crypto_hash.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp index 30fe11be6b3..7d5e3ca4ee3 100644 --- a/src/bench/crypto_hash.cpp +++ b/src/bench/crypto_hash.cpp @@ -134,10 +134,6 @@ static void MuHashDiv(benchmark::Bench& bench) FastRandomContext rng(true); MuHash3072 muhash{rng.randbytes(32)}; - for (size_t i = 0; i < bench.epochIterations(); ++i) { - acc *= muhash; - } - bench.run([&] { acc /= muhash; });