aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/digest/md5/bench/main.cpp
blob: 70672e674137be3becb8973bd848299da9ed3496 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <benchmark/benchmark.h>

#include <library/cpp/digest/md5/md5.h>

#define MD5_DEF(N)                                                  \
    static void MD5Benchmark_##N(benchmark::State& st) {            \
        char buf[N];                                                \
        for (auto _ : st) {                                         \
            Y_DO_NOT_OPTIMIZE_AWAY(MD5().Update(buf, sizeof(buf))); \
        }                                                           \
    }                                                               \
    BENCHMARK(MD5Benchmark_##N);

MD5_DEF(32)
MD5_DEF(64)
MD5_DEF(128)

MD5_DEF(1024)
MD5_DEF(2048)