Add benchmark for MuHash finalization

This commit is contained in:
Pieter Wuille 2021-01-13 12:09:29 -08:00
parent 66aa6a47bd
commit 91ce8cef2d

View file

@ -249,6 +249,19 @@ static void MuHashPrecompute(benchmark::Bench& bench)
});
}
static void MuHashFinalize(benchmark::Bench& bench)
{
FastRandomContext rng(true);
MuHash3072 acc{rng.randbytes(32)};
acc /= MuHash3072{rng.rand256()};
bench.run([&] {
uint256 out;
acc.Finalize(out);
acc /= MuHash3072{out};
});
}
BENCHMARK(BenchRIPEMD160, benchmark::PriorityLevel::HIGH);
BENCHMARK(SHA1, benchmark::PriorityLevel::HIGH);
BENCHMARK(SHA256_STANDARD, benchmark::PriorityLevel::HIGH);
@ -272,3 +285,4 @@ BENCHMARK(MuHash, benchmark::PriorityLevel::HIGH);
BENCHMARK(MuHashMul, benchmark::PriorityLevel::HIGH);
BENCHMARK(MuHashDiv, benchmark::PriorityLevel::HIGH);
BENCHMARK(MuHashPrecompute, benchmark::PriorityLevel::HIGH);
BENCHMARK(MuHashFinalize, benchmark::PriorityLevel::HIGH);