perf: harden interactive call graph resolution - #74
Merged
Conversation
forhappy
marked this pull request as ready for review
July 28, 2026 03:38
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.
Summary
Root cause
The VS Code panel eagerly passed
program.jsonwhenever it existed, so every initial load, direction change, and expansion reparsed and validated a potentially very large optional artifact. Traversal then filtered the complete call-edge list once for every reached node and only applied request bounds after exploring the reachable graph.Impact
Interactive callers/callees now resolve from the required structural graph while explicit CLI callers can still opt into Program IR enrichment. Traversal work and response continuation metadata stay bounded for dense or high-fanout graphs.
On the repository's 26,567-node / 63,204-edge artifact, warm graph-only resolution measured about 0.20 seconds. The 16,000-edge high-fanout regression completes in roughly 0.3–0.5 seconds in an unoptimized test build.
Validation
cargo test -p compass-analysiscargo test -p compass-cli --test call_graph_clicargo clippy -p compass-analysis --tests -- -D warningsnpm test --workspace editors/vscode(62 tests)npm run typecheck --workspace editors/vscodenpm run build --workspace editors/vscodecargo build --release -p compass-cli