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

perf(transformer): React JSX reduce allocations #3522

Merged

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Jun 3, 2024

React JSX transform was creating CompactStrs (which can involve heap allocations) and then converting them back to Atoms to insert into AST.

This PR removes the intermediate CompactStrs and allocates strings directly into the arena without intermediate heap allocations.

Copy link

graphite-app bot commented Jun 3, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “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.

@overlookmotel overlookmotel marked this pull request as ready for review June 3, 2024 17:26
Copy link

codspeed-hq bot commented Jun 3, 2024

CodSpeed Performance Report

Merging #3522 will not alter performance

Comparing 06-03-perf_transformer_react_jsx_reduce_allocations (91519d9) with main (837776e)

Summary

✅ 22 untouched benchmarks

@overlookmotel
Copy link
Contributor Author

overlookmotel commented Jun 3, 2024

In case you're is wondering why I'm bothering making these fairly small optimizations, this is just tidying up the code while I'm going through it figuring out the scopes stuff.

Copy link

graphite-app bot commented Jun 4, 2024

Merge activity

React JSX transform was creating `CompactStr`s (which can involve heap allocations) and then converting them back to `Atom`s to insert into AST.

This PR removes the intermediate `CompactStr`s and allocates strings directly into the arena without intermediate heap allocations.
@Boshen Boshen force-pushed the 06-03-perf_transformer_react_jsx_reuse_same_atom_s branch from 8f0d568 to f3a755c Compare June 4, 2024 03:03
@Boshen Boshen force-pushed the 06-03-perf_transformer_react_jsx_reduce_allocations branch from d6d50d4 to 91519d9 Compare June 4, 2024 03:04
@Boshen Boshen changed the base branch from 06-03-perf_transformer_react_jsx_reuse_same_atom_s to main June 4, 2024 03:07
@graphite-app graphite-app bot merged commit 91519d9 into main Jun 4, 2024
22 checks passed
@graphite-app graphite-app bot deleted the 06-03-perf_transformer_react_jsx_reduce_allocations branch June 4, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant