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 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.") diff --git a/src/benchmarks/match.cpp b/src/benchmarks/match.cpp index d14882519..cece7960b 100644 --- a/src/benchmarks/match.cpp +++ b/src/benchmarks/match.cpp @@ -12,7 +12,6 @@ #include -#include #include #include #include @@ -215,18 +214,15 @@ try FloatCoordinate{FloatLongitude{7.415513992309569}, FloatLatitude{43.73347615145474}}); params.coordinates.push_back( FloatCoordinate{FloatLongitude{7.415342330932617}, FloatLatitude{43.733251335381205}}); - for (size_t index = 0; index < params.coordinates.size(); ++index) - { - params.radiuses.emplace_back(); - } auto run_benchmark = [&](std::optional radiusInMeters) { + params.radiuses = {}; if (radiusInMeters) { - for (auto &radius : params.radiuses) + for (size_t index = 0; index < params.coordinates.size(); ++index) { - radius = *radiusInMeters; + params.radiuses.emplace_back(*radiusInMeters); } } @@ -258,11 +254,10 @@ try << std::endl; }; - run_benchmark(std::nullopt); - run_benchmark(5.0); - run_benchmark(10.0); - run_benchmark(15.0); - run_benchmark(30.0); + for (auto radius : std::vector>{std::nullopt, 5.0, 10.0, 15.0, 30.0}) + { + run_benchmark(radius); + } return EXIT_SUCCESS; } @@ -270,4 +265,4 @@ catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; return EXIT_FAILURE; -} +} \ No newline at end of file