Skip to content

perf(es/parser): Use bitflags to reduce parser context size #10367

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

Merged
merged 7 commits into from
Apr 13, 2025

Conversation

CPunisher
Copy link
Member

@CPunisher CPunisher commented Apr 12, 2025

Context size: 30 bytes -> 4 bytes

@CPunisher CPunisher requested review from a team as code owners April 12, 2025 11:35
Copy link

changeset-bot bot commented Apr 12, 2025

⚠️ No Changeset found

Latest commit: 51a74d0

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

Copy link

codspeed-hq bot commented Apr 12, 2025

CodSpeed Performance Report

Merging #10367 will improve performances by 5.08%

Comparing CPunisher:04-12-perf/parser-context (86ae11e) with main (d3fb992)

Summary

⚡ 14 improvements
✅ 138 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
es/codegen/with-parser/colors 193.6 µs 189.2 µs +2.3%
es/codegen/with-parser/large 1.5 ms 1.5 ms +2.7%
es/parser/angular 30.9 ms 29.5 ms +4.69%
es/parser/backbone 4.8 ms 4.6 ms +4.71%
es/parser/cal-com 93.8 ms 90.7 ms +3.44%
es/parser/colors 127.4 µs 122.5 µs +3.99%
es/parser/jquery 24.8 ms 23.7 ms +4.82%
es/parser/jquery mobile 38.1 ms 36.4 ms +4.63%
es/parser/mootools 19.8 ms 18.8 ms +5.08%
es/parser/three 116.9 ms 112.2 ms +4.22%
es/parser/typescript 663.5 ms 634.3 ms +4.59%
es/parser/underscore 4.2 ms 4 ms +4.89%
es/parser/yui 18.8 ms 18 ms +4.7%
typescript/fast-strip 679.7 µs 660.3 µs +2.94%

@kdy1 kdy1 self-assigned this Apr 12, 2025
@kdy1 kdy1 added this to the Planned milestone Apr 12, 2025
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Wow! It's HUGE. Thank you!

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Oops. CI failed

Fix
Fix
@kdy1 kdy1 changed the title perf(es/parser): use bitflags to reduce parser context size perf(es/parser): Use bitflags to reduce parser context size Apr 13, 2025
@kdy1 kdy1 merged commit a2d3596 into swc-project:main Apr 13, 2025
166 checks passed
@CPunisher CPunisher deleted the 04-12-perf/parser-context branch April 13, 2025 09:51
@kdy1 kdy1 modified the milestones: Planned, v1.11.21 Apr 14, 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.

None yet

2 participants