31void BM_MD5(benchmark::State& state) {
36 for (
auto _ : state) {
37 auto hash = rawspeed::md5::md5_hash(buf.data(), buf.size());
38 benchmark::DoNotOptimize(hash);
41 state.SetComplexityN(buf.size());
42 state.counters.insert({
44 benchmark::Counter(
sizeof(uint8_t) * state.complexity_length_n(),
45 benchmark::Counter::Flags::kIsIterationInvariantRate,
46 benchmark::Counter::kIs1024)},
48 benchmark::Counter(
sizeof(uint8_t) * state.complexity_length_n(),
49 benchmark::Counter::Flags::kIsIterationInvariantRate |
50 benchmark::Counter::Flags::kInvert,
51 benchmark::Counter::kIs1024)},
56 b->Unit(benchmark::kMillisecond);
58 static constexpr int L2dByteSize = 512U * (1U << 10U);
59 static constexpr int MaxBytesOptimal = 25 * 1000 * 1000 *
sizeof(
uint16_t);
66 b->RangeMultiplier(2);
68 b->Arg(MaxBytesOptimal);
70 b->Range(1, 2048UL << 20)->Complexity(benchmark::oN);