perf: extend avoidEntryIife no-parse fast path to multi-entry chunks#21173
Conversation
🦋 Changeset detectedLatest commit: c86c2b3 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 (04633bc). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@04633bc
yarn add -D webpack@https://pkg.pr.new/webpack@04633bc
pnpm add -D webpack@https://pkg.pr.new/webpack@04633bc |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21173 +/- ##
==========================================
- Coverage 92.59% 92.58% -0.01%
==========================================
Files 586 586
Lines 63750 63837 +87
Branches 17664 17691 +27
==========================================
+ Hits 59028 59105 +77
- Misses 4722 4732 +10
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 61.72%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | benchmark "asset-modules-inline", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
324 KB | 1,073 KB | -69.8% |
| ⚡ | Memory | benchmark "lodash", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
858.1 KB | 127.5 KB | ×6.7 |
| ⚡ | Memory | benchmark "asset-modules-bytes", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
888.1 KB | 321 KB | ×2.8 |
| ⚡ | Memory | benchmark "side-effects-reexport", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
1,196.8 KB | 759.6 KB | +57.56% |
| ⚡ | Memory | benchmark "devtool-eval-source-map", scenario '{"name":"mode-production","mode":"production"}' |
8 MB | 5.4 MB | +47.86% |
| ⚡ | Memory | benchmark "many-modules-commonjs", scenario '{"name":"mode-production","mode":"production"}' |
9.9 MB | 7.3 MB | +36.53% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing perf/avoid-entry-iife-multi-entry-fast-path (c86c2b3) with main (2a74860)
Summary
With
optimization.avoidEntryIife, multi-entry chunks re-parsed every inlined concatenated entry (acorn + eslint-scope over the whole rendered app) on every build to check for name collisions.ConcatenatedModulecodegen now also reports its free names, extending the single-entry no-parse fast path from #21167 to multi-entry chunks (rename step ~480ms → ~6ms on a 3k-module two-entry build, byte-identical output).What kind of change does this PR introduce?
perf
Did you add tests for your changes?
Yes —
test/configCases/module/iife-multiple-concatenated-entries(fast path taken) andtest/configCases/module/iife-multiple-concatenated-entries-collision(fast path bails, renaming still applies).Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
AI (Claude Code) was used to implement the change, write the tests, and run the verification/benchmarks under maintainer direction; the result was reviewed before submission.
https://claude.ai/code/session_01AbYA9s4rUycBWPNyZbzP1Y
Generated by Claude Code