summaryrefslogtreecommitdiff
path: root/benchmark/function
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/function')
-rw-r--r--benchmark/function/camera_function.benchmark.cpp4
-rw-r--r--benchmark/function/composite_function.benchmark.cpp12
-rw-r--r--benchmark/function/source_function.benchmark.cpp12
3 files changed, 14 insertions, 14 deletions
diff --git a/benchmark/function/camera_function.benchmark.cpp b/benchmark/function/camera_function.benchmark.cpp
index 52b6bc9f08..51d2e22293 100644
--- a/benchmark/function/camera_function.benchmark.cpp
+++ b/benchmark/function/camera_function.benchmark.cpp
@@ -27,7 +27,7 @@ static void Parse_CameraFunction(benchmark::State& state) {
state.PauseTiming();
auto doc = createFunctionJSON(stopCount);
state.ResumeTiming();
- optional<PropertyValue<float>> result = conversion::convertJSON<PropertyValue<float>>(doc, error);
+ optional<PropertyValue<float>> result = conversion::convertJSON<PropertyValue<float>>(doc, error, false, false);
if (!result) {
state.SkipWithError(error.message.c_str());
}
@@ -39,7 +39,7 @@ static void Evaluate_CameraFunction(benchmark::State& state) {
size_t stopCount = state.range(0);
auto doc = createFunctionJSON(stopCount);
conversion::Error error;
- optional<PropertyValue<float>> function = conversion::convertJSON<PropertyValue<float>>(doc, error);
+ optional<PropertyValue<float>> function = conversion::convertJSON<PropertyValue<float>>(doc, error, false, false);
if (!function) {
state.SkipWithError(error.message.c_str());
}
diff --git a/benchmark/function/composite_function.benchmark.cpp b/benchmark/function/composite_function.benchmark.cpp
index d495a518ca..f16254641f 100644
--- a/benchmark/function/composite_function.benchmark.cpp
+++ b/benchmark/function/composite_function.benchmark.cpp
@@ -5,7 +5,7 @@
#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>
+#include <mbgl/style/conversion/property_value.hpp>
using namespace mbgl;
using namespace mbgl::style;
@@ -27,13 +27,13 @@ static std::string createFunctionJSON(size_t stopCount) {
static void Parse_CompositeFunction(benchmark::State& state) {
size_t stopCount = state.range(0);
-
+
while (state.KeepRunning()) {
conversion::Error error;
state.PauseTiming();
auto doc = createFunctionJSON(stopCount);
state.ResumeTiming();
- optional<DataDrivenPropertyValue<float>> result = conversion::convertJSON<DataDrivenPropertyValue<float>>(doc, error, false);
+ optional<PropertyValue<float>> result = conversion::convertJSON<PropertyValue<float>>(doc, error, true, false);
if (!result) {
state.SkipWithError(error.message.c_str());
}
@@ -45,16 +45,16 @@ static void Evaluate_CompositeFunction(benchmark::State& state) {
size_t stopCount = state.range(0);
auto doc = createFunctionJSON(stopCount);
conversion::Error error;
- optional<DataDrivenPropertyValue<float>> function = conversion::convertJSON<DataDrivenPropertyValue<float>>(doc, error, false);
+ optional<PropertyValue<float>> function = conversion::convertJSON<PropertyValue<float>>(doc, error, true, false);
if (!function) {
state.SkipWithError(error.message.c_str());
}
-
+
while(state.KeepRunning()) {
float z = 24.0f * static_cast<float>(rand() % 100) / 100;
function->asExpression().evaluate(z, StubGeometryTileFeature(PropertyMap { { "x", static_cast<int64_t>(rand() % 100) } }), -1.0f);
}
-
+
state.SetLabel(std::to_string(stopCount).c_str());
}
diff --git a/benchmark/function/source_function.benchmark.cpp b/benchmark/function/source_function.benchmark.cpp
index a5d2f95487..2164b2a418 100644
--- a/benchmark/function/source_function.benchmark.cpp
+++ b/benchmark/function/source_function.benchmark.cpp
@@ -4,7 +4,7 @@
#include <mbgl/style/conversion.hpp>
#include <mbgl/style/conversion/json.hpp>
-#include <mbgl/style/conversion/data_driven_property_value.hpp>
+#include <mbgl/style/conversion/property_value.hpp>
using namespace mbgl;
using namespace mbgl::style;
@@ -22,13 +22,13 @@ static std::string createFunctionJSON(size_t stopCount) {
static void Parse_SourceFunction(benchmark::State& state) {
size_t stopCount = state.range(0);
-
+
while (state.KeepRunning()) {
conversion::Error error;
state.PauseTiming();
auto doc = createFunctionJSON(stopCount);
state.ResumeTiming();
- optional<DataDrivenPropertyValue<float>> result = conversion::convertJSON<DataDrivenPropertyValue<float>>(doc, error, false);
+ optional<PropertyValue<float>> result = conversion::convertJSON<PropertyValue<float>>(doc, error, true, false);
if (!result) {
state.SkipWithError(error.message.c_str());
}
@@ -40,15 +40,15 @@ static void Evaluate_SourceFunction(benchmark::State& state) {
size_t stopCount = state.range(0);
auto doc = createFunctionJSON(stopCount);
conversion::Error error;
- optional<DataDrivenPropertyValue<float>> function = conversion::convertJSON<DataDrivenPropertyValue<float>>(doc, error, false);
+ optional<PropertyValue<float>> function = conversion::convertJSON<PropertyValue<float>>(doc, error, true, false);
if (!function) {
state.SkipWithError(error.message.c_str());
}
-
+
while(state.KeepRunning()) {
function->asExpression().evaluate(StubGeometryTileFeature(PropertyMap { { "x", static_cast<int64_t>(rand() % 100) } }), -1.0f);
}
-
+
state.SetLabel(std::to_string(stopCount).c_str());
}