-
-
Notifications
You must be signed in to change notification settings - Fork 781
perf: improve deterministic chunk ids #11575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the performance of deterministic chunk ID generation by optimizing module ordering operations. The changes replace calls that fetch full module objects with more efficient operations that work directly with module identifiers, reducing unnecessary object allocations and improving sorting performance.
- Replaced
get_ordered_chunk_modules
withget_ordered_chunk_normal_modules_identifier
for better performance - Added new optimized method that returns module identifiers directly instead of full module objects
- Enhanced dependency traversal logic with cycle detection for ExtractCSS dependencies
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
crates/rspack_ids/src/id_helpers.rs | Updated chunk comparison to use optimized identifier-based module ordering |
crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs | Added new efficient method for getting ordered module identifiers and improved dependency handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
🎉 Size decreased by 1.88KB from 47.25MB to 47.24MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #11575 will not alter performanceComparing 🎉 Hooray!
|
Summary
We can make sure that chunk module exists when it is not a runtime module, then we can prevent finding all modules on module graph by
loop_partial
which needs to indexing multiple times.Before:

After:

Related links
Checklist