summaryrefslogtreecommitdiffhomepage
path: root/bench/02-loader.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-06 18:31:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-06 18:32:31 +0100
commit5240a5c28a5225c4c1ebd02eb97c902e10d65657 (patch)
tree54b42729ea3d9c98856968b761eae256439923f6 /bench/02-loader.cpp
parented44ea64a8928d0df162a5cce932eef9bbb5ff55 (diff)
bbb
Diffstat (limited to 'bench/02-loader.cpp')
-rw-r--r--bench/02-loader.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/bench/02-loader.cpp b/bench/02-loader.cpp
deleted file mode 100644
index d4d22520..00000000
--- a/bench/02-loader.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "loader/loader.hpp"
-#include "serialize/json-helper.hpp"
-#include "serialize/anim.hpp"
-#include <Corrade/Containers/ArrayView.h>
-#include <Corrade/Containers/StringIterable.h>
-#include <Corrade/Utility/Path.h>
-#include <benchmark/benchmark.h>
-
-namespace floormat {
-
-namespace {
-
-void Loader_json(benchmark::State& state)
-{
- loader.destroy();
-
- // warmup
- { for (const auto& x : loader.anim_atlas_list())
- json_helper::from_json<anim_def>(Path::join(loader.ANIM_PATH, ""_s.join({x, ".json"})));
- json_helper::from_json<std::vector<nlohmann::json>>(Path::join(loader.VOBJ_PATH, "vobj.json"));
- }
-
- for (auto _ : state)
- for (int i = 0; i < 10; i++)
- {
- for (const auto& x : loader.anim_atlas_list())
- json_helper::from_json<anim_def>(Path::join(loader.ANIM_PATH, ""_s.join({x, ".json"})));
- json_helper::from_json<std::vector<nlohmann::json>>(Path::join(loader.VOBJ_PATH, "vobj.json"));
- }
-}
-
-BENCHMARK(Loader_json)->Unit(benchmark::kMillisecond)->ReportAggregatesOnly();
-
-} // namespace
-
-} // namespace floormat