From f53816a8fd9ec15ef03b5bf45472eda46e53c1ad Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Nov 2023 21:05:35 +0000 Subject: Refactor to further simplify line/point operations Adds another perf test --- test/perf-geoData.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') 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(); -- cgit v1.2.3