summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/api/query.benchmark.cpp27
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);