Repository navigation
perf(backfill-hasher): traverse dependency queue with a cursor - #1256
Merged
Elizabeth Craig (ecraig12345) merged 1 commit intoNov 6, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the dependency-queue traversal optimization.
No open issues 🎉
What changed in this PR
Reduces queue-processing overhead in Lage’s backfill-hasher while preserving existing dependency-resolution behavior.
Changes:
- Replaces repeated
Array.shift()calls with cursor-based FIFO traversal, retaining processed entries until resolution completes. - Adds a wide, shared/cyclic graph test covering traversal order and missing-dependency handling.
- Includes a Beachball patch release note.
| File | Description |
|---|---|
packages/backfill-hasher/src/resolveExternalDependencies.ts |
Advances a cursor through the growing dependency queue. |
packages/backfill-hasher/src/__tests__/resolveExternalDependencies.test.ts |
Adds coverage for breadth-first ordering, shared dependencies, cycles, and a missing leaf. |
change/change-35380e06-8e55-441c-9a55-f1b507d6b01e.json |
Records the queue-traversal optimization as a patch release. |
Review effort: Max
Elizabeth Craig (ecraig12345)
approved these changes
Nov 6, 2026
Elizabeth Craig (ecraig12345)
merged commit Nov 6, 2026
c791069
into
microsoft:main
14 checks passed
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
Requested reviewers: Nemanja Tesic (@nemanjatesic) and Elizabeth Craig (@ecraig12345).
Replace repeated
Array.shift()calls in external dependency resolution with an index that advances through the growing queue. Preserve FIFO traversal, the existing queued/processed sets, version-range resolution, resolved-version deduplication, and missing-package behavior.Processed entries remain in the array until resolution returns. This avoids front-removal work at the cost of retaining those entries for the duration of the call.
Part of the broader Lage performance effort explored in #1238, following the queue-membership change already merged in #1248. This PR is based directly on current
mainand is independent of the other new performance PRs. Git file enumeration is deliberately excluded into its own PR.Validation
mainatcf155216; extracted source and test files exactly match the previously validated implementation.