Skip to content

Conversation

@CPunisher
Copy link
Member

@CPunisher CPunisher commented Aug 12, 2025

Description:

There could be no need to clone entire lexer and parser when calling try_parse_xxx in typescript. Here introduces checkpoints which only contains necessary data to recover from failed trials. This is also the prerequisite for #11000. And we can also remove the Rc<RefCell<T>> in the lexer later

I'm not sure the data is completed for correctness. Let's see the test results.

@changeset-bot
Copy link

changeset-bot bot commented Aug 12, 2025

⚠️ No Changeset found

Latest commit: 416e400

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

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 12, 2025

CodSpeed Performance Report

Merging #11001 will not alter performance

Comparing CPunisher:08-12-perf/checkpoint (416e400) with main (1bb3716)

Summary

✅ 140 untouched benchmarks

@CPunisher CPunisher marked this pull request as ready for review August 12, 2025 13:23
@CPunisher CPunisher requested a review from a team as a code owner August 12, 2025 13:23
@kdy1 kdy1 added this to the Planned milestone Aug 12, 2025
@kdy1 kdy1 merged commit cda08d1 into swc-project:main Aug 12, 2025
173 checks passed
@CPunisher CPunisher deleted the 08-12-perf/checkpoint branch August 13, 2025 06:37
kdy1 pushed a commit that referenced this pull request Aug 13, 2025
**Description:**

See #11001

I also remove `comments` since it's immutable. But we should be careful
not to clone entire parser and lexer (we can ensure this by benchmark)
@kdy1 kdy1 modified the milestones: Planned, 1.13.4 Aug 21, 2025
@swc-project swc-project locked as resolved and limited conversation to collaborators Sep 20, 2025
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.

2 participants