main.cpp 665 B

12345678910111213141516171819
  1. #include <benchmark/benchmark.h>
  2. #include <library/cpp/digest/md5/md5.h>
  3. #define MD5_DEF(N) \
  4. static void MD5Benchmark_##N(benchmark::State& st) { \
  5. char buf[N]; \
  6. for (auto _ : st) { \
  7. Y_DO_NOT_OPTIMIZE_AWAY(MD5().Update(buf, sizeof(buf))); \
  8. } \
  9. } \
  10. BENCHMARK(MD5Benchmark_##N);
  11. MD5_DEF(32)
  12. MD5_DEF(64)
  13. MD5_DEF(128)
  14. MD5_DEF(1024)
  15. MD5_DEF(2048)