Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes memory usage by moving the deallocation of large data structures to background threads using rayon::spawn. This prevents blocking the main thread during expensive drop operations for memory-intensive structs.
- Use
rayon::spawnto drop large data structures asynchronously - Capture and drop removed values from collections in background threads
- Refactor iterator chains to collect intermediate results before parallel processing
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| module_group.rs | Spawn background task to drop removed module group entries |
| mod.rs | Spawn background task to drop combinator after processing |
| module_concatenation_plugin.rs | Refactor parallel iterator and spawn background drop for cache data |
| exports_info.rs | Spawn background task to drop replaced exports info entries |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs
Show resolved
Hide resolved
📦 Binary Size-limit
🎉 Size decreased by 2.13KB from 47.24MB to 47.24MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #11611 will not alter performanceComparing 🎉 Hooray!
|
Summary
We should drop some big data structs in
rayon::spawnif the task only run on main thread.Before:

After:

Related links
Checklist