diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-11 08:45:39 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-11 13:12:53 +0200 |
commit | 44a3a2bfbf5c1ca94f7abcddab86f5873743fdbc (patch) | |
tree | c5cdcbf05ff13826cf6f3cc9b70b871c9213f633 | |
parent | a71d2c6b2ed5b558485eaa234513a2ce9f153dba (diff) |
bench: adjust warmups
-rw-r--r-- | bench/bitmask.cpp | 3 | ||||
-rw-r--r-- | bench/critter.cpp | 2 | ||||
-rw-r--r-- | bench/dijkstra.cpp | 2 | ||||
-rw-r--r-- | bench/loader.cpp | 3 | ||||
-rw-r--r-- | bench/raycast.cpp | 2 |
5 files changed, 8 insertions, 4 deletions
diff --git a/bench/bitmask.cpp b/bench/bitmask.cpp index 1156a9f7..861f6ad7 100644 --- a/bench/bitmask.cpp +++ b/bench/bitmask.cpp @@ -14,8 +14,9 @@ void Bitmask(benchmark::State& state) { auto img = loader.texture(loader.SCENERY_PATH, "door-close"_s); auto bitmask = anim_atlas::make_bitmask(img); - anim_atlas::make_bitmask_(img, bitmask); + for (int i = 0; i < 3; i++) + anim_atlas::make_bitmask_(img, bitmask); for (auto _ : state) anim_atlas::make_bitmask_(img, bitmask); } diff --git a/bench/critter.cpp b/bench/critter.cpp index 17c44617..3f8505c1 100644 --- a/bench/critter.cpp +++ b/bench/critter.cpp @@ -329,7 +329,7 @@ void test_critter() void Critter_move(benchmark::State& st) { - for (int i = 0; i < 2; i++) + for (int i = 0; i < 3; i++) test_critter(); for (auto _ : st) test_critter(); diff --git a/bench/dijkstra.cpp b/bench/dijkstra.cpp index c2f43de6..2a7032ac 100644 --- a/bench/dijkstra.cpp +++ b/bench/dijkstra.cpp @@ -69,6 +69,8 @@ void Dijkstra(benchmark::State& state) } first_run = false; + for (int i = 0; i < 3; i++) + run(); for (auto _ : state) run(); } diff --git a/bench/loader.cpp b/bench/loader.cpp index bb878758..00008d00 100644 --- a/bench/loader.cpp +++ b/bench/loader.cpp @@ -50,7 +50,8 @@ void Loader_json(benchmark::State& state) { loader.destroy(); - run(); + for (int i = 0; i < 3; i++) + run(); for (auto _ : state) run(); } diff --git a/bench/raycast.cpp b/bench/raycast.cpp index f15c8b27..fe5e84c2 100644 --- a/bench/raycast.cpp +++ b/bench/raycast.cpp @@ -98,7 +98,7 @@ void Raycast(benchmark::State& state) } }; - for (int i = 0; i < 50; i++) + for (int i = 0; i < 3; i++) test(); for (auto _ : state) test(); |