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

refactor(transformer/react-refresh): avoid re-creating Atoms #6816

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Oct 23, 2024

Store BoundIdentifier in registrations. This allows removing the call to ctx.ast.atom() which re-allocates a new Atom into the arena - unnecessary as it's already been allocated when the UID was created.

It's unfortunate that Semantic stores symbol names as CompactStrs instead of Atoms, otherwise we could get the name as an Atom without re-allocating it. Hopefully we can make that change in future, and then reduce BoundIdentifier to just contain the SymbolId. But for now, we are kind of stuck with it.

Copy link

graphite-app bot commented Oct 23, 2024

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

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

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Oct 23, 2024
@overlookmotel overlookmotel marked this pull request as ready for review October 23, 2024 12:38
Copy link

codspeed-hq bot commented Oct 23, 2024

CodSpeed Performance Report

Merging #6816 will not alter performance

Comparing 10-23-refactor_transformer_react-refresh_avoid_re-creating_atom_s (4f6dc22) with main (b8dfa19)

Summary

✅ 30 untouched benchmarks

@overlookmotel overlookmotel force-pushed the 10-23-refactor_transformer_react-refresh_shorten_code_by_using_boundidentifier_ branch from 6069c88 to 55a2591 Compare October 23, 2024 13:02
@overlookmotel overlookmotel force-pushed the 10-23-refactor_transformer_react-refresh_avoid_re-creating_atom_s branch from 2e5a190 to 8b21792 Compare October 23, 2024 13:02
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Oct 23, 2024 — with Graphite App
Copy link

graphite-app bot commented Oct 23, 2024

Merge activity

Store `BoundIdentifier` in `registrations`. This allows removing the call to `ctx.ast.atom()` which re-allocates a new `Atom` into the arena - unnecessary as it's already been allocated when the UID was created.

It's unfortunate that `Semantic` stores symbol names as `CompactStr`s instead of `Atom`s, otherwise we could get the name as an `Atom` without re-allocating it. Hopefully we can make that change in future, and then reduce `BoundIdentifier` to just contain the `SymbolId`. But for now, we are kind of stuck with it.
@Dunqing Dunqing force-pushed the 10-23-refactor_transformer_react-refresh_shorten_code_by_using_boundidentifier_ branch from 55a2591 to 8316069 Compare October 23, 2024 13:27
@Dunqing Dunqing force-pushed the 10-23-refactor_transformer_react-refresh_avoid_re-creating_atom_s branch from 8b21792 to 4f6dc22 Compare October 23, 2024 13:27
Base automatically changed from 10-23-refactor_transformer_react-refresh_shorten_code_by_using_boundidentifier_ to main October 23, 2024 13:41
@graphite-app graphite-app bot merged commit 4f6dc22 into main Oct 23, 2024
28 checks passed
@graphite-app graphite-app bot deleted the 10-23-refactor_transformer_react-refresh_avoid_re-creating_atom_s branch October 23, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants