aboutsummaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
Diffstat (limited to 'bench')
-rw-r--r--bench/get-current.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/bench/get-current.cc b/bench/get-current.cc
index b547df0..e475767 100644
--- a/bench/get-current.cc
+++ b/bench/get-current.cc
@@ -30,4 +30,13 @@ static void cpuinfo_get_current_uarch_index(benchmark::State& state) {
}
BENCHMARK(cpuinfo_get_current_uarch_index)->Unit(benchmark::kNanosecond);
+static void cpuinfo_get_current_uarch_index_with_default(benchmark::State& state) {
+ cpuinfo_initialize();
+ while (state.KeepRunning()) {
+ const uint32_t uarch_index = cpuinfo_get_current_uarch_index_with_default(0);
+ benchmark::DoNotOptimize(uarch_index);
+ }
+}
+BENCHMARK(cpuinfo_get_current_uarch_index_with_default)->Unit(benchmark::kNanosecond);
+
BENCHMARK_MAIN();