diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-04 21:05:35 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-04 21:05:35 +0000 |
commit | f53816a8fd9ec15ef03b5bf45472eda46e53c1ad (patch) | |
tree | 8e46ee3c16e2caebe0468494b09c0d60750368b5 /test/perf-geoData.cpp | |
parent | More tests can just use the global fixed data (diff) | |
download | ilt-f53816a8fd9ec15ef03b5bf45472eda46e53c1ad.tar.bz2 ilt-f53816a8fd9ec15ef03b5bf45472eda46e53c1ad.tar.xz ilt-f53816a8fd9ec15ef03b5bf45472eda46e53c1ad.zip |
Refactor to further simplify line/point operations
Adds another perf test
Diffstat (limited to 'test/perf-geoData.cpp')
-rw-r--r-- | test/perf-geoData.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/perf-geoData.cpp b/test/perf-geoData.cpp index e1546c1..2d79a90 100644 --- a/test/perf-geoData.cpp +++ b/test/perf-geoData.cpp @@ -11,8 +11,21 @@ namespace { benchmark::DoNotOptimize(tm.findPoint({315555, 495556})); } } + + void + terrain_walk(benchmark::State & state) + { + const glm::vec2 point {310001, 490000}; + const GeoData::PointFace start {point, tm.findPoint(point)}; + for (auto _ : state) { + tm.walk(start, {319999, 500000}, [](auto f) { + benchmark::DoNotOptimize(f); + }); + } + } } BENCHMARK(terrain_findPoint); +BENCHMARK(terrain_walk); BENCHMARK_MAIN(); |