Skip to content

Conversation

LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Aug 12, 2025

Summary

  • If the chunk filter is not a JavaScript binding function, handle it synchronously to reduce the time consumption introduced by "join_all".
  • Add disconnect_chunks_and_modules and connect_chunk_and_modules on chunk graph to reduce the number of times of obtaining chunk_graph_chunk and chunk_graph_module.
  • Call get_module_chunks in parallel to reduce the number of calls in the subsequent prepare_module_group_map.
  • Cache the results of get_combs based on used_exports to prevent repeated calculations for the same module.
  • When removing duplicate modules, traverse the chunk group with a smaller number of modules to reduce the hashing cost.
  • When the cache group name exists, it is quite likely that the same module will obtain the same cache group key under different chunk sets. In this case, there is no need to add the module again.

Since the running time of bundle splitting is unstable, it is currently judged to be caused by a large number of invocations of rayon for concurrent module removal. There are approximately 5,000 invocations. At this time, if the CPU is busy, performance degradation may occur due to the invocations being blocked. Therefore, the following time consumption is for reference only.

Before:
image

After:
image

Related links

Checklist

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

Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 970baf2
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/689b3e2d8f816c00081bc860
😎 Deploy Preview https://deploy-preview-11364--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the release: performance release: performance related release(mr only) label Aug 12, 2025
@LingyuCoder LingyuCoder force-pushed the perf/bundle-splitting branch from 15af608 to 970baf2 Compare August 12, 2025 13:14
Copy link
Contributor

📦 Binary Size-limit

Comparing 970baf2 to refactor: inline const parser plugin (#11359) by Gengkun

❌ Size increased by 16.50KB from 47.56MB to 47.58MB (⬆️0.03%)

Copy link

codspeed-hq bot commented Aug 12, 2025

CodSpeed Performance Report

Merging #11364 will not alter performance

Comparing perf/bundle-splitting (970baf2) with main (19b2442)

🎉 Hooray! codspeed-node just leveled up to 4.0.1!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched benchmarks

@LingyuCoder LingyuCoder marked this pull request as ready for review August 13, 2025 05:08
@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 05:08
@LingyuCoder LingyuCoder requested a review from JSerFeng as a code owner August 13, 2025 05:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@LingyuCoder LingyuCoder merged commit 1e6e9a9 into main Aug 13, 2025
48 checks passed
@LingyuCoder LingyuCoder deleted the perf/bundle-splitting branch August 13, 2025 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants