Skip to content

perf(buildChunkGraph): avoid unneeded visit#7774

Merged
JSerFeng merged 1 commit intomainfrom
perf/chunking
Sep 4, 2024
Merged

perf(buildChunkGraph): avoid unneeded visit#7774
JSerFeng merged 1 commit intomainfrom
perf/chunking

Conversation

@JSerFeng
Copy link
Copy Markdown
Contributor

@JSerFeng JSerFeng commented Sep 3, 2024

Summary

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

see webpack/webpack#18730

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@JSerFeng JSerFeng marked this pull request as ready for review September 3, 2024 09:18
@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: performance release: performance related release(mr only) labels Sep 3, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 3, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 978ead3
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66d7ee146aa7a600087f86c2

@JSerFeng JSerFeng requested review from SyMind and ahabhgk September 3, 2024 09:26
@JSerFeng JSerFeng force-pushed the perf/chunking branch 2 times, most recently from b6fb055 to 06c612f Compare September 4, 2024 05:17
@JSerFeng JSerFeng merged commit db43efb into main Sep 4, 2024
@JSerFeng JSerFeng deleted the perf/chunking branch September 4, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants