From 11c7ddc84d2f32180cd5cdd74c07fb077f1c2c81 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 19 May 2024 19:30:24 +0200 Subject: [PATCH 1/3] Fix failing gcc-13 based CI jobs (#6886) * Attempt to fix failing CI on gcc-13 jobs * Attempt to fix failing CI on gcc-13 jobs * Attempt to fix failing CI on gcc-13 jobs * Attempt to fix failing CI on gcc-13 jobs * Attempt to fix failing CI on gcc-13 jobs --- .github/workflows/osrm-backend.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index f1b28b310..3b8242153 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -151,7 +151,7 @@ jobs: - name: gcc-13-debug-cov continue-on-error: false node: 20 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 BUILD_TOOLS: ON BUILD_TYPE: Debug CCOMPILER: gcc-13 @@ -248,7 +248,7 @@ jobs: - name: gcc-13-release continue-on-error: false node: 20 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 BUILD_TOOLS: ON BUILD_TYPE: Release CCOMPILER: gcc-13 From 89fce286a7cc93f557971c459c0abaf6077cc697 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 20 May 2024 09:16:53 +0200 Subject: [PATCH 2/3] Fix benchmark script for the case if PR has empty description (#6887) --- scripts/ci/post_benchmark_results.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ci/post_benchmark_results.py b/scripts/ci/post_benchmark_results.py index 3efd5fcad..a5dc38aa5 100644 --- a/scripts/ci/post_benchmark_results.py +++ b/scripts/ci/post_benchmark_results.py @@ -71,9 +71,9 @@ def main(): benchmark_results = collect_benchmark_results(base_folder, pr_folder) pr_details = get_pr_details(REPO_OWNER, REPO_NAME, PR_NUMBER) - pr_body = pr_details.get('body', '') + # in both cases when there is no PR body or PR body is None fallback to empty string + pr_body = pr_details.get('body', '') or '' - markdown_table = create_markdown_table(benchmark_results) new_benchmark_section = f"\n## Benchmark Results\n{markdown_table}\n" @@ -85,7 +85,7 @@ def main(): flags=re.DOTALL ) else: - updated_body = f"{pr_body}\n\n{new_benchmark_section}" + updated_body = f"{pr_body}\n\n{new_benchmark_section}" if len(pr_body) > 0 else new_benchmark_section update_pr_description(REPO_OWNER, REPO_NAME, PR_NUMBER, updated_body) print("PR description updated successfully.") From 8a82d3929ca18902477f19c625ddefa98873473f Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 20 May 2024 11:15:55 +0200 Subject: [PATCH 3/3] Improve map matching benchmark (#6885) --- src/benchmarks/match.cpp | 61 ++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/src/benchmarks/match.cpp b/src/benchmarks/match.cpp index caed1a00b..83ef7ef1b 100644 --- a/src/benchmarks/match.cpp +++ b/src/benchmarks/match.cpp @@ -11,14 +11,14 @@ #include "osrm/status.hpp" #include - +#include #include #include +#include +#include #include #include -#include - int main(int argc, const char *argv[]) try { @@ -214,24 +214,49 @@ try params.coordinates.push_back( FloatCoordinate{FloatLongitude{7.415342330932617}, FloatLatitude{43.733251335381205}}); - TIMER_START(routes); - auto NUM = 100; - for (int i = 0; i < NUM; ++i) + auto run_benchmark = [&](std::optional radiusInMeters) { - engine::api::ResultT result = json::Object(); - const auto rc = osrm.Match(params, result); - auto &json_result = result.get(); - if (rc != Status::Ok || - json_result.values.at("matchings").get().values.size() != 1) + params.radiuses = {}; + if (radiusInMeters) { - return EXIT_FAILURE; + for (size_t index = 0; index < params.coordinates.size(); ++index) + { + params.radiuses.emplace_back(*radiusInMeters); + } } + + TIMER_START(routes); + auto NUM = 100; + for (int i = 0; i < NUM; ++i) + { + engine::api::ResultT result = json::Object(); + const auto rc = osrm.Match(params, result); + auto &json_result = result.get(); + if (rc != Status::Ok || + json_result.values.at("matchings").get().values.size() != 1) + { + throw std::runtime_error{"Couldn't match"}; + } + } + TIMER_STOP(routes); + if (radiusInMeters) + { + std::cout << "Radius " << *radiusInMeters << "m: " << std::endl; + } + else + { + std::cout << "Default radius: " << std::endl; + } + std::cout << (TIMER_MSEC(routes) / NUM) << "ms/req at " << params.coordinates.size() + << " coordinate" << std::endl; + std::cout << (TIMER_MSEC(routes) / NUM / params.coordinates.size()) << "ms/coordinate" + << std::endl; + }; + + for (auto radius : std::vector>{std::nullopt, 5.0, 10.0, 15.0, 30.0}) + { + run_benchmark(radius); } - TIMER_STOP(routes); - std::cout << (TIMER_MSEC(routes) / NUM) << "ms/req at " << params.coordinates.size() - << " coordinate" << std::endl; - std::cout << (TIMER_MSEC(routes) / NUM / params.coordinates.size()) << "ms/coordinate" - << std::endl; return EXIT_SUCCESS; } @@ -239,4 +264,4 @@ catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; return EXIT_FAILURE; -} +} \ No newline at end of file