-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
refactor(transformer/jsx): simplify and remove all AstBuilder::copy
usages
#9209
refactor(transformer/jsx): simplify and remove all AstBuilder::copy
usages
#9209
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #9209 will improve performances by 4.45%Comparing Summary
Benchmarks breakdown
|
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.
Legend!
wat?! |
It is probably related to I added a |
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've got say, this is masterful!
I had not considered taking ownership of the node at the very start, so when I tried to make this change, I got tied up with needing &mut
references everywhere, and it became a hot mess. This is a really clean and simple solution. Very nice.
Additionally... Every method takes only small types as its params (ArenaBox
or a 16-byte enum).
4.5% perf boost.
AND you killed the dreaded AstBuilder::copy
!
Merge it merge it merge it!
Merge activity
|
… usages (#9209) This PR aims to remove all `AstBuilder::copy` and simplify some code.
454a568
to
558ed8b
Compare
Yes, likely it was that. We should take a look at the TS transforms and see if we can get a quick win from |
…er` rather than `drain` (#9216) This change I forgot to do this in #9209, In the case of owning `Vec`, we do not need to obtain the value owner through `drain` but `into_iter`. The diff in this PR is hard to diff. My purpose is to change `drain` to `into_iter`, other changes are for solving the borrow check and keeping the same output.
This PR aims to remove all
AstBuilder::copy
and simplify some code.