diff options
Diffstat (limited to 'bench/02-loader.cpp')
| -rw-r--r-- | bench/02-loader.cpp | 36 |
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 |
