diff options
author | zmiao <miao.zhao@mapbox.com> | 2019-11-07 18:16:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 18:16:31 +0200 |
commit | 2e8a350d68be75d9505fab9dc897c4abbcae05aa (patch) | |
tree | e73bd5c629b3357326e663a8405c35c227b36ff2 /benchmark | |
parent | 1d49c23b8558e8c24a51e7ba84525ddd06f231be (diff) | |
download | qtlocation-mapboxgl-2e8a350d68be75d9505fab9dc897c4abbcae05aa.tar.gz |
[core] Add batch conversion of latLngs to/from screenCoords (#15891)
* [core] Add batch conversion of latLng vs screenCoord
* [core] Take the simple approach
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/api/query.benchmark.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/benchmark/api/query.benchmark.cpp b/benchmark/api/query.benchmark.cpp index 5e7fd823e0..12a28b95e7 100644 --- a/benchmark/api/query.benchmark.cpp +++ b/benchmark/api/query.benchmark.cpp @@ -38,6 +38,30 @@ public: } // end namespace +static void API_queryPixelsForLatLngs(::benchmark::State& state) { + std::vector<LatLng> points; + int count = 10000; + for (int i = 0; i < count; ++i) { + points.emplace_back(1, 1); + } + QueryBenchmark bench; + while (state.KeepRunning()) { + (void)bench.map.pixelsForLatLngs(points); + } +} + +static void API_queryLatLngsForPixels(::benchmark::State& state) { + std::vector<ScreenCoordinate> points; + int count = 10000; + for (int i = 0; i < count; ++i) { + points.emplace_back(1, 1); + } + QueryBenchmark bench; + while (state.KeepRunning()) { + (void)bench.map.latLngsForPixels(points); + } +} + static void API_queryRenderedFeaturesAll(::benchmark::State& state) { QueryBenchmark bench; @@ -61,7 +85,8 @@ static void API_queryRenderedFeaturesLayerFromHighDensity(::benchmark::State& st bench.frontend.getRenderer()->queryRenderedFeatures(bench.box, {{{"road-street" }}, {}}); } } - +BENCHMARK(API_queryPixelsForLatLngs); +BENCHMARK(API_queryLatLngsForPixels); BENCHMARK(API_queryRenderedFeaturesAll); BENCHMARK(API_queryRenderedFeaturesLayerFromLowDensity); BENCHMARK(API_queryRenderedFeaturesLayerFromHighDensity); |