Skip to content

Comments

refactor(transformer/styled_components): make unreachable branch unreachable!#12172

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-09-refactor_transformer_styled_components_make_unreachable_branch_unreachable_
Jul 10, 2025
Merged

refactor(transformer/styled_components): make unreachable branch unreachable!#12172
graphite-app[bot] merged 1 commit intomainfrom
07-09-refactor_transformer_styled_components_make_unreachable_branch_unreachable_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 9, 2025

This branch is unreachable, so use unreachable! for it, rather than return.

Despite unreachable! producing more code, this may still be more performant, because it tells the compiler which branch is going to be taken. Compiler will generate assembly to make the branch which is taken the fast path. Either way, it's a micro micro optimization.

Mainly I think it's preferable because it's clearer when reading the code.

@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 Jul 9, 2025
Copy link
Member Author

overlookmotel commented Jul 9, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 9, 2025

CodSpeed Instrumentation Performance Report

Merging #12172 will not alter performance

Comparing 07-09-refactor_transformer_styled_components_make_unreachable_branch_unreachable_ (4e58a2a) with 07-09-perf_transformer_styled_components_replace_hashmap_with_array (bcd5094)

Summary

✅ 34 untouched benchmarks

Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been away the transformer too long...

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jul 10, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 10, 2025

Merge activity

…eachable!` (#12172)

This branch is unreachable, so use `unreachable!` for it, rather than `return`.

Despite `unreachable!` producing more code, this may still be more performant, because it tells the compiler which branch is going to be taken. Compiler will generate assembly to make the branch which is taken the fast path. Either way, it's a micro micro optimization.

Mainly I think it's preferable because it's clearer when reading the code.
@graphite-app graphite-app bot force-pushed the 07-09-perf_transformer_styled_components_replace_hashmap_with_array branch from a5ab429 to bcd5094 Compare July 10, 2025 00:41
@graphite-app graphite-app bot force-pushed the 07-09-refactor_transformer_styled_components_make_unreachable_branch_unreachable_ branch from df98bf4 to 4e58a2a Compare July 10, 2025 00:41
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 10, 2025
Base automatically changed from 07-09-perf_transformer_styled_components_replace_hashmap_with_array to main July 10, 2025 00:49
@graphite-app graphite-app bot merged commit 4e58a2a into main Jul 10, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 07-09-refactor_transformer_styled_components_make_unreachable_branch_unreachable_ branch July 10, 2025 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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