Skip to content

feat: support perfetto proto as tracing format #10549

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hardfist
Copy link
Contributor

@hardfist hardfist commented Jun 3, 2025

Summary

fix #10530 and

  • add perfetto layer support which use perfetto native protobuf format
  • remove chrome layer support(which means the legacy json format support) and treats chrome layer as alias of perfetto layer t avoid registerGlobalTrace api
  • change logger layer output to json format

Compare

legacy json format

which has following problems

  • track name can't be customized(named using first event name)
  • grouped trace name can't be customized( using Global Trace Event which user doesn't know the meaning)
  • track can't be grouped with custom group, so all plugin loader and other track shows in randomly order, which is hard to pick
    image

native perfetto protocol

After moving from legacy json format to native protocol format we solves the following existing problems of legacy json format

  • assign uuid for every async event to avoid same name async event conflict
  • give meaningful track name for same track event(which use the same name event as track name before)
  • group related track in the same grouped track(eg put all plugin track in plugin analysis group)
loader analysis

image

plugin analysis

image

build overview

image

Todo

reduce trace file size by using interned_data for all module identifier

Checklist

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

Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 325923e
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/684703829d50e40008c5bdcb
😎 Deploy Preview https://deploy-preview-10549--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Jun 3, 2025
Copy link

codspeed-hq bot commented Jun 3, 2025

CodSpeed Performance Report

Merging #10549 will not alter performance

Comparing yj/perfetto-proto (325923e) with main (d15504a)

🎉 Hooray! codspeed-node just leveled up to 4.0.1!

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.

Summary

✅ 12 untouched benchmarks

@hardfist hardfist force-pushed the yj/perfetto-proto branch 2 times, most recently from d9daba8 to d8691f9 Compare June 8, 2025 11:47
@hardfist hardfist force-pushed the yj/perfetto-proto branch from 511a069 to 6d01649 Compare June 9, 2025 11:22
@hardfist hardfist changed the title fix: support perfetto proto as tracing format feat: support perfetto proto as tracing format Jun 9, 2025
@github-actions github-actions bot added release: feature release: feature related release(mr only) and removed release: bug fix release: bug related release(mr only) labels Jun 9, 2025
@hardfist hardfist marked this pull request as ready for review June 9, 2025 15:38
@hardfist hardfist requested review from h-a-n-a and JSerFeng as code owners June 9, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: produce the protobuf format trace not the json format
2 participants