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/nullish-coalescing): avoid repeated symbol lookups #7272

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Nov 13, 2024

clone_expression was unnecessarily looking up the SymbolId of references multiple times. Use BoundIdentifier instead to avoid that.

Notes:

  • create_conditional_expression has to take all parts as Expressions just to support this ?? something.
  • TraverseCtx::is_static also handles Super, but can skip that in this case as super ?? something is not valid syntax.

Copy link

graphite-app bot commented Nov 13, 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 Nov 13, 2024
@overlookmotel overlookmotel marked this pull request as ready for review November 13, 2024 15:51
Copy link

codspeed-hq bot commented Nov 13, 2024

CodSpeed Performance Report

Merging #7272 will not alter performance

Comparing 11-13-refactor_transformer_nullish-coalescing_avoid_repeated_symbol_lookups (345fbb9) with main (01ddf37)

Summary

✅ 30 untouched benchmarks

@overlookmotel overlookmotel force-pushed the 11-13-refactor_transformer_nullish-coalescing_avoid_repeated_symbol_lookups branch from d23e8da to 4ced135 Compare November 13, 2024 15:57
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 14, 2024
Copy link

graphite-app bot commented Nov 14, 2024

Merge activity

…ps (#7272)

`clone_expression` was unnecessarily looking up the `SymbolId` of references multiple times. Use `BoundIdentifier` instead to avoid that.

Notes:

* `create_conditional_expression` has to take all parts as `Expression`s just to support `this ?? something`.
* `TraverseCtx::is_static` also handles `Super`, but can skip that in this case as `super ?? something` is not valid syntax.
@Boshen Boshen force-pushed the 11-13-fix_transformer_nullish-coalescing_correct_span branch from 7428d93 to 5b5c8a9 Compare November 14, 2024 16:18
@Boshen Boshen force-pushed the 11-13-refactor_transformer_nullish-coalescing_avoid_repeated_symbol_lookups branch from 4ced135 to 345fbb9 Compare November 14, 2024 16:18
Base automatically changed from 11-13-fix_transformer_nullish-coalescing_correct_span to main November 14, 2024 16:28
@graphite-app graphite-app bot merged commit 345fbb9 into main Nov 14, 2024
28 checks passed
@graphite-app graphite-app bot deleted the 11-13-refactor_transformer_nullish-coalescing_avoid_repeated_symbol_lookups branch November 14, 2024 16:32
Dunqing pushed a commit that referenced this pull request Nov 17, 2024
…ps (#7272)

`clone_expression` was unnecessarily looking up the `SymbolId` of references multiple times. Use `BoundIdentifier` instead to avoid that.

Notes:

* `create_conditional_expression` has to take all parts as `Expression`s just to support `this ?? something`.
* `TraverseCtx::is_static` also handles `Super`, but can skip that in this case as `super ?? something` is not valid syntax.
Dunqing pushed a commit that referenced this pull request Nov 18, 2024
…ps (#7272)

`clone_expression` was unnecessarily looking up the `SymbolId` of references multiple times. Use `BoundIdentifier` instead to avoid that.

Notes:

* `create_conditional_expression` has to take all parts as `Expression`s just to support `this ?? something`.
* `TraverseCtx::is_static` also handles `Super`, but can skip that in this case as `super ?? something` is not valid syntax.
Dunqing pushed a commit that referenced this pull request Nov 18, 2024
…ps (#7272)

`clone_expression` was unnecessarily looking up the `SymbolId` of references multiple times. Use `BoundIdentifier` instead to avoid that.

Notes:

* `create_conditional_expression` has to take all parts as `Expression`s just to support `this ?? something`.
* `TraverseCtx::is_static` also handles `Super`, but can skip that in this case as `super ?? something` is not valid syntax.
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.

1 participant