-
-
Notifications
You must be signed in to change notification settings - Fork 491
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(transformer/jsx): no string comparisons generating pragma expression #7620
perf(transformer/jsx): no string comparisons generating pragma expression #7620
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #7620 will not alter performanceComparing Summary
|
Merge activity
|
eb8bcdf
to
171c635
Compare
67e3461
to
d7b011f
Compare
…sion (#7620) #7553 introduced support for some unusual JSX pragmas e.g. `this.foo` and `import.meta.foo`. We want to support these to pass tests, but they're very unlikely to be used in practice. Identify these strange patterns when parsing the pragma (which happens only once per file), and encode them as an enum. The removes expensive string comparisons from `Pragma::create_expression` (which is called for every JSX element), and keeps the path for common cases fast.
171c635
to
8ad52be
Compare
d7b011f
to
3b1e63e
Compare
#7553 introduced support for some unusual JSX pragmas e.g.
this.foo
andimport.meta.foo
. We want to support these to pass tests, but they're very unlikely to be used in practice.Identify these strange patterns when parsing the pragma (which happens only once per file), and encode them as an enum. The removes expensive string comparisons from
Pragma::create_expression
(which is called for every JSX element), and keeps the path for common cases fast.