Skip to content

perf(target-graph): deduplicate subgraph queue traversal - #1250

Merged
Elizabeth Craig (ecraig12345) merged 3 commits into
microsoft:mainfrom
djordjem88:user/djmaks/lage-subgraph-queue
Nov 5, 2026
Merged

Elizabeth Craig (ecraig12345) merged 3 commits into
microsoft:mainfrom
djordjem88:user/djmaks/lage-subgraph-queue

Conversation

@djordjem88

Copy link
Copy Markdown
Contributor

Summary

Requested reviewers: Nemanja Tesic (@nemanjatesic) and Elizabeth Craig (@ecraig12345).

Use an index cursor for the subgraph traversal queue and mark targets when enqueued. This avoids repeated front removal and duplicate inspection requests while retaining all dependency edges and their ordering.

Part of the broader Lage performance effort explored in #1238. This change is self-contained and can merge independently. It affects only subgraph extraction, not external-dependency resolution.

Validation

  • Independent branch: target-graph suite passed (39 tests, 7 snapshots).
  • Added coverage for shared dependencies, duplicate/empty/missing entries, repeated extraction, source-graph immutability, cycles, and missing dependencies.
  • Full local CI passed during development of the combined series; this is not a claim about GitHub PR CI.
  • Includes a Beachball patch change file.

Djordje Maksimovic and others added 2 commits November 3, 2026 11:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the subgraph-extraction optimization.

No open issues 🎉

What changed in this PR

Optimizes Lage’s subgraph extraction as a self-contained part of the performance effort in #1238. The change avoids redundant queue work while preserving dependency edges, ordering, and priorities; external-dependency resolution is unchanged.

Changes:

  • Replaces front removal with an index cursor and deduplicates targets when enqueued.
  • Adds coverage for shared dependencies, duplicate/empty/missing entries, repeated extraction, source-graph immutability, cycles, and missing dependencies.
  • Includes a Beachball patch release note.
File Description
packages/​target-graph/​src/​TargetGraphBuilder.ts Uses cursor-based traversal and prevents duplicate enqueues.
packages/​target-graph/​src/​__tests__/​TargetGraphBuilder.test.ts Adds regression coverage for graph semantics and edge cases.
change/​change-63a47ed4-130c-40f3-b16a-7cddba3f7b29.json Records the target-graph performance improvement for a patch release.

Review effort: Max

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58
@ecraig12345
Elizabeth Craig (ecraig12345) merged commit 39d417a into microsoft:main Nov 5, 2026
14 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.

3 participants