From c03d3f8b91b798f21663214ebe883f7aad25f5d3 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 24 Mar 2024 19:16:13 +0800 Subject: [PATCH] update: enhance benchmark suites --- benchmark.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/benchmark.cc b/benchmark.cc index 77a30ca..71c8637 100644 --- a/benchmark.cc +++ b/benchmark.cc @@ -12,16 +12,14 @@ std::string build_test_data() { } static void MD5_Digest(benchmark::State &state) { - MD5 md5; - for (auto _ : state) { + for (constexpr MD5 md5; auto _ : state) { auto volatile holder = md5.Digest(); } } static void MD5_Update(benchmark::State &state) { - MD5 md5; const auto data = build_test_data(); - for (auto _ : state) { + for (MD5 md5; auto _ : state) { md5.Update(data.c_str(), state.range(0)); } }