summaryrefslogtreecommitdiff
path: root/benchmark/function/source_function.benchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/function/source_function.benchmark.cpp')
-rw-r--r--benchmark/function/source_function.benchmark.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/benchmark/function/source_function.benchmark.cpp b/benchmark/function/source_function.benchmark.cpp
index af361943e3..402c9b89d2 100644
--- a/benchmark/function/source_function.benchmark.cpp
+++ b/benchmark/function/source_function.benchmark.cpp
@@ -2,11 +2,9 @@
#include <mbgl/benchmark/stub_geometry_tile_feature.hpp>
-#include <mbgl/style/function/source_function.hpp>
-
#include <mbgl/style/conversion.hpp>
#include <mbgl/style/conversion/json.hpp>
-#include <mbgl/style/conversion/function.hpp>
+#include <mbgl/style/conversion/data_driven_property_value.hpp>
using namespace mbgl;
using namespace mbgl::style;
@@ -30,7 +28,7 @@ static void Parse_SourceFunction(benchmark::State& state) {
state.PauseTiming();
auto doc = createFunctionJSON(stopCount);
state.ResumeTiming();
- optional<SourceFunction<float>> result = conversion::convertJSON<SourceFunction<float>>(doc, error);
+ optional<DataDrivenPropertyValue<float>> result = conversion::convertJSON<DataDrivenPropertyValue<float>>(doc, error);
if (!result) {
state.SkipWithError(error.message.c_str());
}
@@ -42,13 +40,13 @@ static void Evaluate_SourceFunction(benchmark::State& state) {
size_t stopCount = state.range(0);
auto doc = createFunctionJSON(stopCount);
conversion::Error error;
- optional<SourceFunction<float>> function = conversion::convertJSON<SourceFunction<float>>(doc, error);
+ optional<DataDrivenPropertyValue<float>> function = conversion::convertJSON<DataDrivenPropertyValue<float>>(doc, error);
if (!function) {
state.SkipWithError(error.message.c_str());
}
while(state.KeepRunning()) {
- function->evaluate(StubGeometryTileFeature(PropertyMap { { "x", static_cast<int64_t>(rand() % 100) } }), -1.0f);
+ function->asExpression().evaluate(StubGeometryTileFeature(PropertyMap { { "x", static_cast<int64_t>(rand() % 100) } }), -1.0f);
}
state.SetLabel(std::to_string(stopCount).c_str());