aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/digest/md5/bench/main.cpp
blob: a987eefe59fa1d0d9198e68ad7c42a9f1fb7f2e7 (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)