Skip to content

perf: harden interactive call graph resolution - #74

Merged
forhappy merged 1 commit into
mainfrom
codex/harden-call-graph-resolution
Jul 28, 2026
Merged

perf: harden interactive call graph resolution#74
forhappy merged 1 commit into
mainfrom
codex/harden-call-graph-resolution

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

  • keep interactive VS Code call-graph resolution on the structural graph instead of reparsing optional Program IR for every reveal
  • index caller/callee adjacency once per request instead of rescanning every edge for each visited node
  • enforce node, edge, and continuation bounds during traversal
  • add high-fanout latency coverage and an extension command-boundary regression

Root cause

The VS Code panel eagerly passed program.json whenever 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-analysis
  • cargo test -p compass-cli --test call_graph_cli
  • cargo clippy -p compass-analysis --tests -- -D warnings
  • npm test --workspace editors/vscode (62 tests)
  • npm run typecheck --workspace editors/vscode
  • npm run build --workspace editors/vscode
  • cargo build --release -p compass-cli

@forhappy
forhappy marked this pull request as ready for review July 28, 2026 03:38
@forhappy
forhappy merged commit bfc76a0 into main Jul 28, 2026
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant