diff --git a/benchmark/benchmark.cpp b/benchmark/benchmark.cpp index c72040ab8f..5c142c4162 100644 --- a/benchmark/benchmark.cpp +++ b/benchmark/benchmark.cpp @@ -63,20 +63,12 @@ bytes to_bytes(const std::string& source) { return output; }; -void benchmarking(const std::string& name, - const std::function& func, - uint32_t max_num_runs) { - +void benchmarking(const std::string& name, const std::function& func) { uint64_t total{0}; uint64_t min{std::numeric_limits::max()}; uint64_t max{0}; - // some benchmarked functions are expensive and run in a transaction - // (like BLS pairing). Limit actual number of runs to the function - // specific maximum such that transaction deadline is not exceeded. - uint32_t actual_num_runs = (num_runs > max_num_runs) ? max_num_runs : num_runs; - - for (auto i = 0U; i < actual_num_runs; ++i) { + for (auto i = 0U; i < num_runs; ++i) { auto start_time = std::chrono::high_resolution_clock::now(); func(); auto end_time = std::chrono::high_resolution_clock::now(); @@ -87,7 +79,7 @@ void benchmarking(const std::string& name, max = std::max(max, duration); } - print_results(name, actual_num_runs, total, min, max); + print_results(name, num_runs, total, min, max); } } // benchmark diff --git a/benchmark/benchmark.hpp b/benchmark/benchmark.hpp index 6ac14e4c47..51fe4b6af9 100644 --- a/benchmark/benchmark.hpp +++ b/benchmark/benchmark.hpp @@ -22,6 +22,6 @@ void hash_benchmarking(); void blake2_benchmarking(); void bls_benchmarking(); -void benchmarking(const std::string& name, const std::function& func, uint32_t max_num_runs = std::numeric_limits::max()); +void benchmarking(const std::string& name, const std::function& func); } // benchmark