From a6e268b445f84a1916a54ee60b3d1b66254c35a1 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 22 May 2024 16:27:19 +0200 Subject: [PATCH] Add benchmark for route --- src/benchmarks/route.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/benchmarks/route.cpp b/src/benchmarks/route.cpp index 26f18ab13..ea95d06fb 100644 --- a/src/benchmarks/route.cpp +++ b/src/benchmarks/route.cpp @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -49,6 +50,7 @@ try RouteParameters::OverviewType overview; bool steps = false; std::optional alternatives = std::nullopt; + std::optional radius = std::nullopt; }; auto run_benchmark = [&](const Benchmark &benchmark) @@ -62,6 +64,12 @@ try params.alternatives = *benchmark.alternatives; } + if (benchmark.radius) + { + params.radiuses = std::vector>( + params.coordinates.size(), boost::make_optional(*benchmark.radius)); + } + TIMER_START(routes); auto NUM = 1000; for (int i = 0; i < NUM; ++i) @@ -118,7 +126,29 @@ try {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, RouteParameters::OverviewType::False, false, - 3} + 3}, + {"1000 routes, 3 coordinates, no alternatives, overview=false, steps=false, radius=750", + {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, + {FloatLongitude{7.421844922513342}, FloatLatitude{43.73690777888953}}, + {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::False, + false, + std::nullopt, + 750}, + {"1000 routes, 2 coordinates, no alternatives, overview=false, steps=false, radius=750", + {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, + {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::False, + false, + std::nullopt, + 750}, + {"1000 routes, 2 coordinates, 3 alternatives, overview=false, steps=false, radius=750", + {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, + {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::False, + false, + 3, + 750} };