Skip to content

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)
  • change logger layer output to json format for better support for parsing

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).

@netlify
Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 6656f1a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6847bebbce841900089935bf

@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
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 3, 2025

CodSpeed Performance Report

Merging #10549 will not alter performance

Comparing yj/perfetto-proto (6656f1a) with main (6719a7f)

🎉 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.

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 and others added 2 commits June 9, 2025 23:24
@hardfist hardfist marked this pull request as ready for review June 9, 2025 15:38
@hardfist hardfist requested review from JSerFeng and h-a-n-a as code owners June 9, 2025 15:38
@github-actions
Copy link
Contributor

github-actions bot commented Jun 10, 2025

📝 Benchmark detail: Open

Name Base (d15504a d15504a) Current Change
10000_big_production-mode_disable-minimize + exec 35.4 s ± 776 ms 35.4 s ± 499 ms -0.06 %
10000_development-mode + exec 1.88 s ± 21 ms 1.81 s ± 28 ms -3.96 %
10000_development-mode_hmr + exec 764 ms ± 25 ms 747 ms ± 21 ms -2.13 %
10000_production-mode + exec 2.37 s ± 368 ms 2.23 s ± 33 ms -5.57 %
10000_production-mode_persistent-cold + exec 2.44 s ± 77 ms 2.41 s ± 139 ms -1.21 %
10000_production-mode_persistent-hot + exec 1.72 s ± 18 ms 1.69 s ± 30 ms -1.78 %
arco-pro_development-mode + exec 1.79 s ± 45 ms 1.8 s ± 79 ms +0.68 %
arco-pro_development-mode_hmr + exec 386 ms ± 1.2 ms 385 ms ± 3 ms -0.18 %
arco-pro_production-mode + exec 3.42 s ± 92 ms 3.32 s ± 96 ms -3.09 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.56 s ± 71 ms 3.48 s ± 373 ms -2.46 %
arco-pro_production-mode_persistent-cold + exec 3.47 s ± 51 ms 3.44 s ± 114 ms -0.98 %
arco-pro_production-mode_persistent-hot + exec 2.05 s ± 64 ms 2.01 s ± 37 ms -2.28 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.42 s ± 137 ms 3.38 s ± 75 ms -1.31 %
large-dyn-imports_development-mode + exec 2.12 s ± 19 ms 2.05 s ± 27 ms -3.27 %
large-dyn-imports_production-mode + exec 2.1 s ± 45 ms 2.06 s ± 34 ms -1.76 %
threejs_development-mode_10x + exec 1.49 s ± 34 ms 1.48 s ± 44 ms -1.16 %
threejs_development-mode_10x_hmr + exec 868 ms ± 19 ms 866 ms ± 25 ms -0.31 %
threejs_production-mode_10x + exec 4.81 s ± 32 ms 4.79 s ± 36 ms -0.30 %
threejs_production-mode_10x_persistent-cold + exec 4.93 s ± 40 ms 4.91 s ± 36 ms -0.33 %
threejs_production-mode_10x_persistent-hot + exec 4.31 s ± 316 ms 4.23 s ± 65 ms -1.88 %
10000_big_production-mode_disable-minimize + rss memory 9284 MiB ± 202 MiB 9189 MiB ± 252 MiB -1.02 %
10000_development-mode + rss memory 668 MiB ± 17.2 MiB 660 MiB ± 28.8 MiB -1.11 %
10000_development-mode_hmr + rss memory 800 MiB ± 13.4 MiB 788 MiB ± 9.61 MiB -1.52 %
10000_production-mode + rss memory 654 MiB ± 20.9 MiB 671 MiB ± 22.5 MiB +2.71 %
10000_production-mode_persistent-cold + rss memory 766 MiB ± 39 MiB 763 MiB ± 44.6 MiB -0.39 %
10000_production-mode_persistent-hot + rss memory 773 MiB ± 46.2 MiB 761 MiB ± 32.8 MiB -1.49 %
arco-pro_development-mode + rss memory 574 MiB ± 69.4 MiB 588 MiB ± 36.7 MiB +2.57 %
arco-pro_development-mode_hmr + rss memory 486 MiB ± 41.3 MiB 514 MiB ± 22.4 MiB +5.68 %
arco-pro_production-mode + rss memory 684 MiB ± 55.1 MiB 690 MiB ± 72.2 MiB +0.77 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 723 MiB ± 90.6 MiB 744 MiB ± 114 MiB +2.97 %
arco-pro_production-mode_persistent-cold + rss memory 804 MiB ± 81.9 MiB 784 MiB ± 20 MiB -2.50 %
arco-pro_production-mode_persistent-hot + rss memory 657 MiB ± 75.2 MiB 641 MiB ± 66.2 MiB -2.34 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 685 MiB ± 65 MiB 709 MiB ± 20.8 MiB +3.51 %
large-dyn-imports_development-mode + rss memory 657 MiB ± 2.32 MiB 681 MiB ± 9.81 MiB +3.68 %
large-dyn-imports_production-mode + rss memory 546 MiB ± 4.59 MiB 572 MiB ± 8.06 MiB +4.74 %
threejs_development-mode_10x + rss memory 622 MiB ± 15.1 MiB 638 MiB ± 18.7 MiB +2.58 %
threejs_development-mode_10x_hmr + rss memory 820 MiB ± 70.2 MiB 813 MiB ± 44.7 MiB -0.90 %
threejs_production-mode_10x + rss memory 856 MiB ± 12.7 MiB 876 MiB ± 16.5 MiB +2.38 %
threejs_production-mode_10x_persistent-cold + rss memory 981 MiB ± 47.1 MiB 995 MiB ± 24.3 MiB +1.49 %
threejs_production-mode_10x_persistent-hot + rss memory 832 MiB ± 39.4 MiB 856 MiB ± 25.6 MiB +2.84 %

Co-authored-by: pshu <stormslowly@gmail.com>
Copy link
Contributor

@stormslowly stormslowly left a comment

Choose a reason for hiding this comment

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

nice job

@hardfist hardfist merged commit a6cb5d0 into main Jun 10, 2025
34 checks passed
@hardfist hardfist deleted the yj/perfetto-proto branch June 10, 2025 08:39
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

3 participants