Add comprehensive profiling suite for core routing algorithm with UW Campus OSM data#53
Draft
Add comprehensive profiling suite for core routing algorithm with UW Campus OSM data#53
Conversation
…th UW Campus OSM data Co-authored-by: bmander <51985+bmander@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] In order to find performance bottlenecks in existing code we want to profile code in tough real world scenarios. Write a script that profiles the core routing algorithm loaded with uw_campus.osm data. Use rhe route_planner as a guide. Keep in mind thou...
Add comprehensive profiling suite for core routing algorithm with UW Campus OSM data
Aug 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a complete profiling suite to identify performance bottlenecks in the core GraphServer routing algorithm using real-world UW Campus OSM data scenarios.
Problem Statement
To find performance bottlenecks in existing code, we needed profiling tools that exercise the core C routing algorithm with realistic workloads rather than synthetic test data. The existing performance tests used simple synthetic providers, but real-world routing involves complex OSM data parsing and network connectivity challenges.
Solution
The profiling suite focuses on profiling the C code implementation rather than Python wrapper overhead, providing detailed insights into core routing performance bottlenecks.
Key Components
C-based Core Profiler (
scripts/profile_routing.c)clock_gettime()for microsecond accuracyPython OSM Integration (
scripts/profile_osm_routing.py)Build System & Convenience Tools
Makefilewith multiple profiling modes: standard, gprof, valgrind, stress testingrun_profiler.shconvenience script with colored output and error handlingKey Results
The profiler successfully identifies that
total_planning(encompassinggs_plan_simpleand core Dijkstra implementation) consumes 97-99% of execution time, providing clear direction for optimization efforts:Additional insights include:
Usage
The profiling suite provides the foundation for identifying and addressing performance bottlenecks in tough real-world scenarios, focusing analysis on the core C routing implementation where optimization efforts will have the most impact.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.