You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a new implement of flag dependency usage plugin strategy just like the part of #10712 but consider of the get mode cache and repeat modules. The same is process modules in batches but keep Queue and cache to avoid repeat computing.
And also this PR has been tested in rome case and will not lead to performance regression.
Comparing refactor/flag-usage (9f0dc07) with main (b9ec3fd)
🎉 Hooray! codspeed-rust just leveled up to 2.7.2!
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.
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR parallelizes the flag dependency usage plugin to improve build performance by processing modules in batches using Rayon's parallel iterators while maintaining a queue and cache to avoid redundant computations.
Refactored the main processing loop to collect modules into batches and process them in parallel
Extracted logic into separate functions (merge_referenced_exports, collect_active_dependencies, get_dependency_referenced_exports) for better modularity and parallelization
Added an is_empty() method to the Queue utility for proper batch processing control
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File
Description
crates/rspack_util/src/queue.rs
Added is_empty() method to support batch processing logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
release: performancerelease: performance related release(mr only)teamThe issue/pr is created by the member of Rspack.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a new implement of flag dependency usage plugin strategy just like the part of #10712 but consider of the get mode cache and repeat modules. The same is process modules in batches but keep
Queueand cache to avoid repeat computing.And also this PR has been tested in rome case and will not lead to performance regression.
Before:

After:

Related links
Checklist