Skip to content
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

fix(es/typescript): Handle unicode for fast ts strip #9202

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

magic-akari
Copy link
Member

Description:

BREAKING CHANGE:

Related issue (if exists):

@magic-akari magic-akari requested a review from a team as a code owner July 11, 2024 08:14
@magic-akari magic-akari changed the title fix(es/typescript): Handle unicode fix(es/typescript): Handle unicode for fast ts strip Jul 11, 2024
@kdy1 kdy1 self-assigned this Jul 11, 2024
@kdy1 kdy1 added this to the Planned milestone Jul 11, 2024
Comment on lines +674 to +675
// This is bit magic equivalent to: b < 128 || b >= 192
(*self as i8) >= -0x40
Copy link

Choose a reason for hiding this comment

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

Is this copied from some legacy code, or eyeball optimized? The expression in comment compiles to exact same code with the "optimized" one: https://godbolt.org/z/KsqjM8jad

IMO, readability is more important if they are actually the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy from std::core::num::u8

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.

swc-bump:

  • swc_fast_ts_strip

@kdy1 kdy1 enabled auto-merge (squash) July 11, 2024 08:59
@kdy1 kdy1 disabled auto-merge July 11, 2024 09:08
@kdy1 kdy1 merged commit 096bfe3 into swc-project:main Jul 11, 2024
149 of 150 checks passed
Copy link

codspeed-hq bot commented Jul 11, 2024

CodSpeed Performance Report

Merging #9202 will improve performances by 5.84%

Comparing magic-akari:fast-ts-strip (730ee90) with magic-akari:fast-ts-strip (d66b35a)

Summary

⚡ 2 improvements
✅ 171 untouched benchmarks

Benchmarks breakdown

Benchmark magic-akari:fast-ts-strip magic-akari:fast-ts-strip Change
es/full/bugs-1 618 µs 584 µs +5.84%
parse_and_babelify_jquery 123.8 ms 120.1 ms +3.13%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants