Skip to content

Conversation

@stormslowly
Copy link
Contributor

To check if tracing has a performance cost

Description:

BREAKING CHANGE:

Related issue (if exists):

@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

⚠️ No Changeset found

Latest commit: c15e4df

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kdy1
Copy link
Member

kdy1 commented Nov 6, 2025

It has a noticeable cost. You can try enabling tracing/max_level_off

@stormslowly stormslowly force-pushed the chore/try_no_instrument branch from f5721a4 to ecd55a6 Compare November 6, 2025 03:34
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 6, 2025

CodSpeed Performance Report

Merging #11237 will improve performance by 10.2%

Comparing stormslowly:chore/try_no_instrument (c15e4df) with main (ee40804)

Summary

⚡ 21 improvements
✅ 117 untouched

Benchmarks breakdown

Benchmark BASE HEAD Efficiency
parse_and_babelify_angular 159.5 ms 144.7 ms +10.2%
parse_and_babelify_jquery_mobile 169.5 ms 166.2 ms +2.02%
babelify-only 2.1 ms 2 ms +2.81%
parse_and_babelify_mootools 72.6 ms 71.1 ms +2.17%
parse_and_babelify_yui 67.5 ms 66 ms +2.23%
parse_and_babelify_backbone 15.4 ms 15 ms +2.58%
parse_and_babelify_jquery 99 ms 97 ms +2.05%
parse_and_babelify_underscore 13.2 ms 12.9 ms +2.55%
es/target/es2015 1.2 ms 1.2 ms +4.88%
es/full-target/es2017 592 µs 579.5 µs +2.16%
es/full-target/es2018 555.4 µs 543.1 µs +2.28%
es2015_arrow 301.4 µs 294.8 µs +2.24%
es/target/es2020 483.6 µs 470.9 µs +2.7%
es/full-target/es2016 628.9 µs 616.3 µs +2.05%
es2015_block_scoping 457.9 µs 443.4 µs +3.27%
es2015_parameters 334.1 µs 324.8 µs +2.86%
es/preset-env/usage/builtin_type 231.6 µs 215.8 µs +7.3%
es/preset-env/usage/property 109.1 µs 100.7 µs +8.3%
es/codegen/with-parser/large 1.1 ms 1.1 ms +2.11%
es/codegen/colors 68.4 µs 66.8 µs +2.42%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@stormslowly
Copy link
Contributor Author

In rspack-resolver, when I enable max_level_off and release_max_level_off, I still get 2~15% performance loss in benchmark.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31473288 bytes)

Commit: b9f5c70

@kdy1
Copy link
Member

kdy1 commented Nov 6, 2025

I think it's a good idea to remove all tracing code, considering the perf difference

@stormslowly
Copy link
Contributor Author

According to codspeed's report, the most improved step is enabling max_level_off.
That's quite different from rspack-resolver's case.
I will do some digging to find the season and figure out a way to improve performance and keep trackability.

@stormslowly stormslowly force-pushed the chore/try_no_instrument branch from ba32429 to db95ecf Compare December 20, 2025 14:25
@stormslowly stormslowly force-pushed the chore/try_no_instrument branch from db95ecf to eb6042c Compare December 20, 2025 14:57
@socket-security
Copy link

socket-security bot commented Dec 20, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants