-
-
Notifications
You must be signed in to change notification settings - Fork 764
perf: improve try_to_add
of module concatenation
#11279
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 canceled.
|
📝 Benchmark detail: Open
|
📦 Binary Size-limit
❌ Size increased by 3.00KB from 50.31MB to 50.31MB (⬆️0.01%) |
CodSpeed Performance ReportMerging #11279 will not alter performanceComparing Summary
Footnotes |
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 the try_to_add
function in the module concatenation plugin by implementing several caching optimizations. The changes reduce unnecessary module graph lookups, runtime calculations, and connection activity checks during module concatenation.
- Optimizes
getCachedReadableIdentifier()
calls to avoid repeated module lookups - Caches module runtime information to prevent recalculation
- Caches connection active states to avoid repeated
is_active
calls
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
module_concatenation_plugin.rs | Refactors function signatures, adds caching mechanisms for runtime and connection states, implements new helper function for optimized connection activity checks |
concatenated_module.rs | Updates all calls to get_cached_readable_identifier() to use new signature with module identifier instead of module instance |
Summary
getCachedReadableIdentifier()
to prevent unnecessary getting module instance by identifier from module graphtry_to_add
is_active
every time of callingtry_to_add
Before:

After:

Related links
Checklist