Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #920 +/- ##
==========================================
+ Coverage 77.14% 77.18% +0.04%
==========================================
Files 130 130
Lines 11868 11883 +15
Branches 1458 1462 +4
==========================================
+ Hits 9155 9172 +17
+ Misses 2331 2330 -1
+ Partials 382 381 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The previous implementation scanned all edges on every iteration of a fixed-point loop, resulting in O(depth * edges) complexity. For deep dependency chains this is catastrophic - a 5000-node chain required 5000 full passes over all edges. Replace with a standard Breadth-First Search using an adjacency list built once upfront, reducing complexity to O(vertices + edges). Benchmarks on large graphs show 22x-1333x speedups depending on graph shape, with identical results verified against the original algorithm.
86d36d8 to
56fb085
Compare
Contributor
|
If you haven't already, testing this with Gecko would be a good additional sanity check (eg: that it produces identical graphs, no exceptions, etc.). |
Contributor
Author
I have tested this against gecko and found no diffs on the generated graphs. |
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.
The previous implementation scanned all edges on every iteration of a fixed-point loop, resulting in O(depth * edges) complexity. For deep dependency chains this is catastrophic - a 5000-node chain required 5000 full passes over all edges.
Replace with a standard Breadth-First Search using an adjacency list built once upfront, reducing complexity to O(vertices + edges). Benchmarks on large graphs show 22x-1333x speedups depending on graph shape, with identical results verified against the original algorithm.