Skip to content

perf: disable perfetto tracing in release binding#13932

Merged
chenjiahan merged 1 commit into
web-infra-dev:mainfrom
hardfist:codex/disable-perfetto-release
May 7, 2026
Merged

perf: disable perfetto tracing in release binding#13932
chenjiahan merged 1 commit into
web-infra-dev:mainfrom
hardfist:codex/disable-perfetto-release

Conversation

@hardfist

@hardfist hardfist commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Gate Perfetto tracing behind a Cargo feature and keep release node binding builds from enabling it.
  • Expose rspack.experiments.globalTrace.supportsPerfetto and default CLI profiling to the logger layer when Perfetto is unavailable.
  • Update profile tests to pass with both Perfetto-enabled and no-Perfetto bindings.

Related links

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings May 7, 2026 04:06
@github-actions github-actions Bot added the release: bug fix release: bug related release(mr only) label May 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 perfetto Cargo feature, making Perfetto tracing optional across rspack_tracing and the binding crates.
  • Expose RSPACK_SUPPORTS_PERFETTO_TRACE to JS and add rspack.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.

Comment thread crates/rspack_binding_api/src/trace_event.rs Outdated
Comment thread packages/rspack-cli/tests/build/profile/profile.test.ts Outdated
@hardfist hardfist force-pushed the codex/disable-perfetto-release branch from e55a762 to f68b672 Compare May 7, 2026 04:30
@codspeed-hq

codspeed-hq Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 34 untouched benchmarks


Comparing hardfist:codex/disable-perfetto-release (d14f57e) with main (3004365)

Open in CodSpeed

@hardfist hardfist force-pushed the codex/disable-perfetto-release branch 3 times, most recently from 7744537 to a4f9418 Compare May 7, 2026 05:50
@hardfist hardfist force-pushed the codex/disable-perfetto-release branch from a4f9418 to d14f57e Compare May 7, 2026 06:33
@hardfist hardfist enabled auto-merge (squash) May 7, 2026 06:37
@hardfist hardfist requested review from chenjiahan and stormslowly May 7, 2026 06:40
@chenjiahan chenjiahan changed the title fix: disable perfetto tracing in release binding perf: disable perfetto tracing in release binding May 7, 2026
@github-actions github-actions Bot added release: performance release: performance related release(mr only) and removed release: bug fix release: bug related release(mr only) labels May 7, 2026
@chenjiahan chenjiahan disabled auto-merge May 7, 2026 07:02
@chenjiahan chenjiahan enabled auto-merge (squash) May 7, 2026 07:02
@chenjiahan chenjiahan merged commit 5a0506f into web-infra-dev:main May 7, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: performance release: performance related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants