summaryrefslogtreecommitdiff
path: root/test/perf-terrain.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-29 14:11:46 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-29 15:26:09 +0000
commit49a422ed91289a31142a8c0fb8b7030d2dea98a1 (patch)
tree9bdc69a8f6ee4cc6eda388eea6e0baa5606ff4b5 /test/perf-terrain.cpp
parentInitial OpenMesh based terrain data and tests (diff)
downloadilt-49a422ed91289a31142a8c0fb8b7030d2dea98a1.tar.bz2
ilt-49a422ed91289a31142a8c0fb8b7030d2dea98a1.tar.xz
ilt-49a422ed91289a31142a8c0fb8b7030d2dea98a1.zip
Initial commit of findPoint on terrain
2D navigate from a default/given starting point, possible scope for improvement, but it's not exactly slow; <9ms
Diffstat (limited to 'test/perf-terrain.cpp')
-rw-r--r--test/perf-terrain.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/perf-terrain.cpp b/test/perf-terrain.cpp
new file mode 100644
index 0000000..e998f60
--- /dev/null
+++ b/test/perf-terrain.cpp
@@ -0,0 +1,18 @@
+#include <benchmark/benchmark.h>
+#include <game/terrain2.h>
+
+namespace {
+ const TerrainMesh tm {FIXTURESDIR "height/SD19.asc"};
+
+ void
+ terrain_findPoint(benchmark::State & state)
+ {
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(tm.findPoint({315555, 495556}));
+ }
+ }
+}
+
+BENCHMARK(terrain_findPoint);
+
+BENCHMARK_MAIN();