-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: disable pnp when bench #134
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
CodSpeed Performance ReportMerging #134 will improve performances by 57.52%Comparing Summary
Benchmarks breakdown
|
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 refactors the benchmark code to properly disable Plug'n'Play (PnP) features during non-PnP-related benchmarks, separating performance concerns. The changes introduce a new FileSystemOptions struct to control PnP behavior and update benchmarks to explicitly set PnP flags.
Key changes:
- Added
FileSystemOptionsstruct withenable_pnpfield to configure filesystem behavior - Introduced
FileSystemOs::new()constructor to accept custom filesystem options - Updated benchmark resolver creation to explicitly disable PnP for non-PnP benchmarks
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/lib.rs | Exports FileSystemOptions to make it available for benchmarks |
| src/file_system.rs | Adds FileSystemOs::new() method to accept custom options |
| benches/resolver.rs | Refactors resolver creation to accept PnP flag and disables it for non-PnP benchmarks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| fn rspack_resolver() -> rspack_resolver::Resolver { | ||
| fn rspack_resolver(enable_pnp: bool) -> rspack_resolver::Resolver { |
Copilot
AI
Nov 23, 2025
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.
The enable_pnp parameter is only used when the yarn_pnp feature is enabled. To avoid compilation warnings about unused parameters when the feature is disabled, consider either:
- Prefixing the parameter with an underscore:
_enable_pnp: bool - Or applying a
#[allow(unused_variables)]attribute when the feature is disabled
Example:
fn rspack_resolver(
#[cfg_attr(not(feature = "yarn_pnp"), allow(unused_variables))]
enable_pnp: bool
) -> rspack_resolver::Resolver {| fn rspack_resolver(enable_pnp: bool) -> rspack_resolver::Resolver { | |
| fn rspack_resolver( | |
| #[cfg_attr(not(feature = "yarn_pnp"), allow(unused_variables))] | |
| enable_pnp: bool | |
| ) -> rspack_resolver::Resolver { |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Note: it's not a perf PR.
It simply disables PnP features in the file system while performing non-PnP-related benchmarks, and separates performance concerns.