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

#include <util/generic/xrange.h>

#define MD5_DEF(N)                                                  \
    Y_CPU_BENCHMARK(MD5_##N, iface) {                               \
        char buf[N];                                                \
        for (const auto i : xrange(iface.Iterations())) {           \
            Y_UNUSED(i);                                            \
            Y_DO_NOT_OPTIMIZE_AWAY(MD5().Update(buf, sizeof(buf))); \
        }                                                           \
    }

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

MD5_DEF(1024)
MD5_DEF(2048)