perf: linearize manifest component expansion#180
Open
johnson-ricon wants to merge 1 commit into
Open
Conversation
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.
Finding
PR #177's fixed-point component expansion rescans every manifest edge until no ID or path is added. Edge order can make a long alias chain advance only one hop per pass, so this stage is quadratic in manifest size. A 3,001-ID reverse-ordered synthetic component took 7.258 seconds at exact reviewed head
3de63a2, despite the PR's scaling goal.This fix builds the same bipartite ID/path components with union-find and then selects all IDs whose component contains a seed. The same 3,001-ID case returns all 3,001 IDs in 0.096 seconds, with no new subprocesses or blob materialization.
Validation
mise run test— 404 BATS tests and 9 Python tests passedmise run test diff— 14/14 passedmise run doctorpassed; optional local pre-commit hook remains uninstalledbash -n lib/diff.sh .mise/tasks/diffreadme build --checkgit diff --checkFixes one adversarial review finding on #176.