summaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-11 08:28:17 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-11 13:12:53 +0200
commita71d2c6b2ed5b558485eaa234513a2ce9f153dba (patch)
tree3db3c5afaac92e27c558d6c0020e8f2fe7e68694 /bench
parent9ebe54046fe3f0d8759973b1f9117269adeae099 (diff)
bench: speed up when built with -O0
Diffstat (limited to 'bench')
-rw-r--r--bench/bitmask.cpp5
-rw-r--r--bench/critter.cpp5
-rw-r--r--bench/raycast.cpp5
3 files changed, 6 insertions, 9 deletions
diff --git a/bench/bitmask.cpp b/bench/bitmask.cpp
index 3fd4d77c..1156a9f7 100644
--- a/bench/bitmask.cpp
+++ b/bench/bitmask.cpp
@@ -17,11 +17,10 @@ void Bitmask(benchmark::State& state)
anim_atlas::make_bitmask_(img, bitmask);
for (auto _ : state)
- for (int i = 0; i < 10; i++)
- anim_atlas::make_bitmask_(img, bitmask);
+ anim_atlas::make_bitmask_(img, bitmask);
}
-BENCHMARK(Bitmask)->Unit(benchmark::kMillisecond);
+BENCHMARK(Bitmask)->Unit(benchmark::kMicrosecond);
} // namespace
diff --git a/bench/critter.cpp b/bench/critter.cpp
index 56bfa9b5..17c44617 100644
--- a/bench/critter.cpp
+++ b/bench/critter.cpp
@@ -332,11 +332,10 @@ void Critter_move(benchmark::State& st)
for (int i = 0; i < 2; i++)
test_critter();
for (auto _ : st)
- for (int i = 0; i < 10; i++)
- test_critter();
+ test_critter();
}
-BENCHMARK(Critter_move)->Unit(benchmark::kMillisecond);
+BENCHMARK(Critter_move)->Unit(benchmark::kMicrosecond);
} // namespace
diff --git a/bench/raycast.cpp b/bench/raycast.cpp
index 63f4ad4a..f15c8b27 100644
--- a/bench/raycast.cpp
+++ b/bench/raycast.cpp
@@ -101,11 +101,10 @@ void Raycast(benchmark::State& state)
for (int i = 0; i < 50; i++)
test();
for (auto _ : state)
- for (int i = 0; i < 1000; i++)
- test();
+ test();
}
-BENCHMARK(Raycast)->Unit(benchmark::kMillisecond);
+BENCHMARK(Raycast)->Unit(benchmark::kMicrosecond);
} // namespace