Skip to content

Comments

perf(transformer): React JSX reduce allocations#3522

Merged
graphite-app[bot] merged 1 commit intomainfrom
06-03-perf_transformer_react_jsx_reduce_allocations
Jun 4, 2024
Merged

perf(transformer): React JSX reduce allocations#3522
graphite-app[bot] merged 1 commit intomainfrom
06-03-perf_transformer_react_jsx_reduce_allocations

Conversation

@overlookmotel
Copy link
Member

@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.

@graphite-app
Copy link
Contributor

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.

Copy link
Member Author

overlookmotel commented Jun 3, 2024

@overlookmotel overlookmotel marked this pull request as ready for review June 3, 2024 17:26
@codspeed-hq
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
Member 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.

@graphite-app
Copy link
Contributor

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
@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