perf: disable perfetto tracing in release binding#13932
Merged
chenjiahan merged 1 commit intoMay 7, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR gates Perfetto tracing behind a Cargo feature so release node binding builds don’t enable it by default, and updates the JS/CLI surface area to detect when Perfetto isn’t available and fall back to the logger trace layer.
Changes:
- Introduce a
perfettoCargo feature, making Perfetto tracing optional acrossrspack_tracingand the binding crates. - Expose
RSPACK_SUPPORTS_PERFETTO_TRACEto JS and addrspack.experiments.globalTrace.supportsPerfetto. - Update CLI profiling defaults and tests to work with both Perfetto-enabled and Perfetto-disabled bindings.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/src/exports.ts | Adds supportsPerfetto and guards perfetto registration when unsupported. |
| packages/rspack-cli/tests/build/profile/profile.test.ts | Adjusts profile tests to assert different outputs depending on Perfetto support. |
| packages/rspack-cli/src/utils/profile.ts | Defaults CLI tracing layer to logger when Perfetto isn’t supported. |
| crates/rspack_tracing/src/lib.rs | Conditionally compiles/exports Perfetto tracer behind the perfetto feature. |
| crates/rspack_tracing/Cargo.toml | Adds perfetto feature and makes rspack_tracing_perfetto optional. |
| crates/rspack_binding_api/src/trace_event.rs | Conditionally enables Perfetto tracer and returns a clear error when not built in. |
| crates/rspack_binding_api/src/lib.rs | Exposes RSPACK_SUPPORTS_PERFETTO_TRACE constant to JS via napi. |
| crates/rspack_binding_api/Cargo.toml | Adds perfetto feature plumbing and makes perfetto dependency optional. |
| crates/node_binding/scripts/build.js | Enables perfetto feature for non-release builds. |
| crates/node_binding/rspack.wasi.cjs | Re-exports RSPACK_SUPPORTS_PERFETTO_TRACE from the WASI binding. |
| crates/node_binding/rspack.wasi-browser.js | Re-exports RSPACK_SUPPORTS_PERFETTO_TRACE from the browser WASI binding. |
| crates/node_binding/Cargo.toml | Adds perfetto feature passthrough to binding API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e55a762 to
f68b672
Compare
Contributor
7744537 to
a4f9418
Compare
a4f9418 to
d14f57e
Compare
chenjiahan
approved these changes
May 7, 2026
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
rspack.experiments.globalTrace.supportsPerfettoand default CLI profiling to the logger layer when Perfetto is unavailable.Related links
N/A
Checklist