Skip to content

perf(buildChunkGraph): avoid unneeded re-visit#18730

Merged
alexander-akait merged 1 commit intowebpack:mainfrom
JSerFeng:perf/chunk-graph
Sep 3, 2024
Merged

perf(buildChunkGraph): avoid unneeded re-visit#18730
alexander-akait merged 1 commit intowebpack:mainfrom
JSerFeng:perf/chunk-graph

Conversation

@JSerFeng
Copy link
Copy Markdown
Contributor

@JSerFeng JSerFeng commented Sep 2, 2024

What kind of change does this PR introduce?

Improve performance of code-splitting

see following module-graph

image

if module other has a lots of sub modules, we can avoid revisit those modules if minAvailableModules stays the same

Current behavior

module a dyn imports module b, buildChunkGraph will first create chunk a for module a, fills chunk a, then create chunk b for module b, fills chunk b.

if module b has another parent, then chunk b will be outdated and will be visited again, and fills chunk b again. But if chunk b has no minAvailableModules changes, we can skip visiting it, as it won't have any differences

Did you add tests for your changes?

No

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

@webpack-bot
Copy link
Copy Markdown
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@JSerFeng JSerFeng force-pushed the perf/chunk-graph branch 5 times, most recently from 6d2eae6 to 612dbde Compare September 3, 2024 08:41
@JSerFeng JSerFeng marked this pull request as ready for review September 3, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants