From afe4e2a110459f8a926e8af5c906db3a948d2f48 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 21 May 2024 22:42:00 +0200 Subject: [PATCH] Add benchmark for route --- src/benchmarks/route.cpp | 41 ++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/benchmarks/route.cpp b/src/benchmarks/route.cpp index add1aeabe..7b8827c5e 100644 --- a/src/benchmarks/route.cpp +++ b/src/benchmarks/route.cpp @@ -46,14 +46,16 @@ try { std::string name; std::vector coordinates; + RouteParameters::OverviewType overview; + bool steps = false; std::optional alternatives = std::nullopt; }; auto run_benchmark = [&](const Benchmark &benchmark) { RouteParameters params; - params.overview = RouteParameters::OverviewType::Full; - params.steps = true; + params.overview = benchmark.overview; + params.steps = benchmark.steps; params.coordinates = benchmark.coordinates; if (benchmark.alternatives) { @@ -79,19 +81,46 @@ try }; std::vector benchmarks = { - {"1000 routes, 3 coordinates, no alternatives", + {"1000 routes, 3 coordinates, no alternatives, overview=full, steps=true", {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, {FloatLongitude{7.421844922513342}, FloatLatitude{43.73690777888953}}, {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::Full, + true, std::nullopt}, - {"1000 routes, 2 coordinates, no alternatives", + {"1000 routes, 2 coordinates, no alternatives, overview=full, steps=true", {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::Full, + true, std::nullopt}, - {"1000 routes, 2 coordinates, 3 alternatives", + {"1000 routes, 2 coordinates, 3 alternatives, overview=full, steps=true", {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, - 3}}; + RouteParameters::OverviewType::Full, + true, + 3}, + {"1000 routes, 3 coordinates, no alternatives, overview=false, steps=false", + {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, + {FloatLongitude{7.421844922513342}, FloatLatitude{43.73690777888953}}, + {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::False, + false, + std::nullopt}, + {"1000 routes, 2 coordinates, no alternatives, overview=false, steps=false", + {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, + {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::False, + false, + std::nullopt}, + {"1000 routes, 2 coordinates, 3 alternatives, overview=false, steps=false", + {{FloatLongitude{7.437602352715465}, FloatLatitude{43.75030522209604}}, + {FloatLongitude{7.412303912230966}, FloatLatitude{43.72851046529198}}}, + RouteParameters::OverviewType::False, + false, + 3} + + }; for (const auto &benchmark : benchmarks) {