summaryrefslogtreecommitdiff
path: root/benchmark/parse/filter.benchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/parse/filter.benchmark.cpp')
-rw-r--r--benchmark/parse/filter.benchmark.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/benchmark/parse/filter.benchmark.cpp b/benchmark/parse/filter.benchmark.cpp
index 4984668400..e4cf635256 100644
--- a/benchmark/parse/filter.benchmark.cpp
+++ b/benchmark/parse/filter.benchmark.cpp
@@ -6,6 +6,7 @@
#include <mbgl/style/conversion/json.hpp>
#include <mbgl/style/conversion/filter.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
+#include <mbgl/benchmark/stub_geometry_tile_feature.hpp>
using namespace mbgl;
@@ -22,15 +23,11 @@ static void Parse_Filter(benchmark::State& state) {
static void Parse_EvaluateFilter(benchmark::State& state) {
const style::Filter filter = parse(R"FILTER(["==", "foo", "bar"])FILTER");
- const PropertyMap properties = { { "foo", std::string("bar") } };
+ const StubGeometryTileFeature feature = { {}, FeatureType::Unknown , {}, {{ "foo", std::string("bar") }} };
+ const style::expression::EvaluationContext context = { &feature };
while (state.KeepRunning()) {
- filter(FeatureType::Unknown, {}, [&] (const std::string& key) -> optional<Value> {
- auto it = properties.find(key);
- if (it == properties.end())
- return {};
- return it->second;
- });
+ filter(context);
}
}