Skip to content

Comments

perf(transformer/typescript): reverse order of checks#15722

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-15-perf_transformer_typescript_reverse_order_of_checks
Nov 17, 2025
Merged

perf(transformer/typescript): reverse order of checks#15722
graphite-app[bot] merged 1 commit intomainfrom
11-15-perf_transformer_typescript_reverse_order_of_checks

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 15, 2025

Tiny perf optimization. It's cheaper to check declare property once you know the type of the Declaration. Declaration::declare has to branch on the type of the Declaration.

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Nov 15, 2025
Copy link
Member Author

overlookmotel commented Nov 15, 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.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Nov 15, 2025
@overlookmotel overlookmotel marked this pull request as ready for review November 15, 2025 15:22
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 15, 2025

CodSpeed Performance Report

Merging #15722 will not alter performance

Comparing 11-15-perf_transformer_typescript_reverse_order_of_checks (6b4cdae) with main (32f4fdd)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

  1. No successful run was found on 11-06-fix_ast_add_tsglobaldeclaration_type (3fee43e) during the generation of this report, so main (32f4fdd) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
Copy link
Member Author

overlookmotel commented Nov 17, 2025

Merge activity

  • Nov 17, 5:36 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 17, 6:11 PM UTC: graphite-app added this pull request to the Graphite merge queue.
  • Nov 17, 6:11 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #15712.
  • Nov 17, 6:11 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #15712.
  • Nov 17, 7:25 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 17, 7:25 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Nov 17, 7:34 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 17, 7:34 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Nov 17, 7:35 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from 11-06-fix_ast_add_tsglobaldeclaration_type to graphite-base/15722 November 17, 2025 17:37
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
@overlookmotel overlookmotel force-pushed the 11-15-perf_transformer_typescript_reverse_order_of_checks branch from 74572d3 to 6b4cdae Compare November 17, 2025 18:17
@overlookmotel overlookmotel changed the base branch from graphite-base/15722 to 11-06-fix_ast_add_tsglobaldeclaration_type November 17, 2025 18:17
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
Tiny perf optimization. It's cheaper to check `declare` property once you know the type of the `Declaration`. `Declaration::declare` has to branch on the type of the `Declaration`.
@graphite-app graphite-app bot force-pushed the 11-06-fix_ast_add_tsglobaldeclaration_type branch from 3fee43e to cbb27fd Compare November 17, 2025 19:25
@graphite-app graphite-app bot requested a review from camc314 as a code owner November 17, 2025 19:25
@graphite-app graphite-app bot force-pushed the 11-15-perf_transformer_typescript_reverse_order_of_checks branch from 6b4cdae to b4b0ed8 Compare November 17, 2025 19:26
Base automatically changed from 11-06-fix_ast_add_tsglobaldeclaration_type to main November 17, 2025 19:30
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
@graphite-app graphite-app bot merged commit b4b0ed8 into main Nov 17, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 11-15-perf_transformer_typescript_reverse_order_of_checks branch November 17, 2025 19:35
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
overlookmotel pushed a commit that referenced this pull request Nov 24, 2025
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (#15712)
(overlookmotel)

### 🚀 Features

- 0c1f82b linter/plugins: Add `tokens` property to `Program` (#16020)
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (#15869) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (#15770)
(Dunqing)

### 🐛 Bug Fixes

- e2ca770 codegen: Add support for printing type arguments in new
expressions (#15963) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (#16014)
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (#15929) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (#15830) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (#15778) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(#15723) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (#15495) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (#15800) (copilot-swe-agent)

### ⚡ Performance

- b4b0ed8 transformer/typescript: Reverse order of checks (#15722)
(overlookmotel)

### 📚 Documentation

- c81a331 data_structures: Doc comments on fields of `Stack` (#15793)
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (#15781)
(overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
)

Tiny perf optimization. It's cheaper to check `declare` property once you know the type of the `Declaration`. `Declaration::declare` has to branch on the type of the `Declaration`.
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (oxc-project#15712)
(overlookmotel)

### 🚀 Features

- 0c1f82b linter/plugins: Add `tokens` property to `Program` (oxc-project#16020)
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (oxc-project#15869) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (oxc-project#15770)
(Dunqing)

### 🐛 Bug Fixes

- e2ca770 codegen: Add support for printing type arguments in new
expressions (oxc-project#15963) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (oxc-project#16014)
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (oxc-project#15929) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (oxc-project#15830) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (oxc-project#15778) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(oxc-project#15723) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (oxc-project#15495) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (oxc-project#15800) (copilot-swe-agent)

### ⚡ Performance

- b4b0ed8 transformer/typescript: Reverse order of checks (oxc-project#15722)
(overlookmotel)

### 📚 Documentation

- c81a331 data_structures: Doc comments on fields of `Stack` (oxc-project#15793)
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (oxc-project#15781)
(overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
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-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants