aboutsummaryrefslogtreecommitdiff
path: root/src/bench/crypto_hash.cpp
diff options
context:
space:
mode:
authorMartin Ankerl <martin.ankerl@gmail.com>2021-09-17 13:38:11 +0200
committerMartin Ankerl <martin.ankerl@gmail.com>2021-09-21 11:46:01 +0200
commit468b232f71562280aae16876bc257ec24f5fcccb (patch)
tree366e60293649df4fc57980acdf0d6e1b18800e41 /src/bench/crypto_hash.cpp
parenteed99cf272426e5957bee35dc8e7d0798aec8ec0 (diff)
downloadbitcoin-468b232f71562280aae16876bc257ec24f5fcccb.tar.xz
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.
Diffstat (limited to 'src/bench/crypto_hash.cpp')
-rw-r--r--src/bench/crypto_hash.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp
index 30fe11be6b..7d5e3ca4ee 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;
});