fix: dedup symlink targets in FileSystemInfo context-hash walk#21088
Conversation
🦋 Changeset detectedLatest commit: 300fd43 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This PR is packaged and the instant preview is available (faee810). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@faee810
yarn add -D webpack@https://pkg.pr.new/webpack@faee810
pnpm add -D webpack@https://pkg.pr.new/webpack@faee810 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21088 +/- ##
==========================================
+ Coverage 91.66% 91.95% +0.29%
==========================================
Files 581 581
Lines 61089 61240 +151
Branches 16659 16703 +44
==========================================
+ Hits 55995 56315 +320
+ Misses 5094 4925 -169
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by 88.33%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | benchmark "context-esm", scenario '{"name":"mode-production","mode":"production"}' |
7.3 MB | 9.2 MB | -20.24% |
| ⚡ | Memory | benchmark "wasm-modules-async", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
3,050 KB | 390.1 KB | ×7.8 |
| ⚡ | Memory | benchmark "many-modules-commonjs", scenario '{"name":"mode-development","mode":"development"}' |
1,830 KB | 922.2 KB | +98.45% |
| ⚡ | Memory | benchmark "side-effects-reexport", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
883.5 KB | 586 KB | +50.78% |
| ⚡ | Memory | benchmark "future-defaults", scenario '{"name":"mode-production","mode":"production"}' |
9.8 MB | 7.7 MB | +26.97% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/issue-21084-breaking-change-vKF8y (300fd43) with main (b0d3696)
Cyclic symlink graphs (pnpm peer-variant back-edges) caused the context resolution queue in processAsyncTree to re-push already-visited targets indefinitely, overflowing V8's array limit (RangeError: Invalid array length). Add a per-walk visited Set keyed on the target path in _resolveContextTimestamp, _resolveContextHash, and _resolveContextTsh so each real directory is visited at most once and the walk terminates. Closes #21084.
4806b01 to
300fd43
Compare
Cyclic symlink graphs (pnpm peer-variant back-edges) caused the context
resolution queue in processAsyncTree to re-push already-visited targets
indefinitely, overflowing V8's array limit (RangeError: Invalid array length).
Add a per-walk visited Set keyed on the target path in _resolveContextTimestamp,
_resolveContextHash, and _resolveContextTsh so each real directory is visited at
most once and the walk terminates. Closes #21084.