-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
perf(es/parser): Optimize lexing of template literals #9036
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swc-bump:
- swc_core
- swc_ecma_parser
raw.push(c); | ||
raw_slice_start = self.cur_pos(); | ||
} else { | ||
self.bump(); | ||
|
||
if let Ok(ref mut cooked) = cooked { | ||
cooked.push(c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should cooked
have the same optimization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. I'll patch it tomorrow.
**Description:** Applies same trick as #9036, but for `cooked`
### Description Update `swc_core` to `v0.93.4`. To apply swc-project/swc#9036 and swc-project/swc#9037. Those PR makes parsing of some files 5x faster. ### Testing Instructions See next.js counterpart: vercel/next.js#66781
### What? Update `swc_core` to `v0.93.4`. ### Why? To apply swc-project/swc#9036 and swc-project/swc#9037. Those PR makes parsing of some files 5x faster. ### How?
Description:
We don't need to push one char at a time.