Add comprehensive profiling suite for core routing algorithm with UW Campus OSM data #53
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
Makefile
with multiple profiling modes: standard, gprof, valgrind, stress testingrun_profiler.sh
convenience script with colored output and error handlingKey Results
The profiler successfully identifies that
total_planning
(encompassinggs_plan_simple
and 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.