-
-
Couldn't load subscription status.
- Fork 729
fix: perf regression caused by is_deferred #11944
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.
|
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 addresses a performance regression by caching the has_imported_by_defer flag in the module's build metadata instead of iterating through incoming connections on every call to is_deferred. The optimization moves the computation from query-time to build-time.
- Adds a new
has_imported_by_deferfield toBuildMetato cache deferred import status - Updates
is_deferredmethod to use the cached flag instead of iterating connections - Computes and sets the flag during module graph updates in the
AddTask
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/rspack_core/src/module_graph/mod.rs | Simplifies is_deferred to use cached flag and removes DependencyType import |
| crates/rspack_core/src/module.rs | Adds has_imported_by_defer field to BuildMeta struct |
| crates/rspack_core/src/compilation/make/graph_updater/repair/add.rs | Computes and sets has_imported_by_defer during module resolution |
| crates/rspack_binding_api/src/module.rs | Updates JS binding to include new has_imported_by_defer field |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
crates/rspack_core/src/compilation/make/graph_updater/repair/add.rs
Outdated
Show resolved
Hide resolved
crates/rspack_core/src/compilation/make/graph_updater/repair/add.rs
Outdated
Show resolved
Hide resolved
|
📝 Benchmark detail: Open
|
📦 Binary Size-limit
❌ Size increased by 1.75KB from 47.73MB to 47.73MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #11944 will not alter performanceComparing Summary
|
32c5209 to
9be15f2
Compare
|
📝 Benchmark detail: Open
|
Summary
We can record the
has_imported_by_deferat make, and avoid iterate on incoming connectionsRelated links
Checklist