Skip to content

perf(isolated-declarations): replace hash collections with index-based Vec#19221

Merged
graphite-app[bot] merged 1 commit intomainfrom
perf/isolated-declarations
Feb 11, 2026
Merged

perf(isolated-declarations): replace hash collections with index-based Vec#19221
graphite-app[bot] merged 1 commit intomainfrom
perf/isolated-declarations

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Feb 10, 2026

Summary

  • Eliminate redundant transformed_spans: FxHashSet<Span> by consolidating passthrough cases into transformed_stmts
  • Replace transformed_stmts: FxHashMap<Span, Statement> with Vec<Option<Statement>> indexed by statement position for O(1) lookups
  • Merge get_assignable_properties_for_namespaces into report_error_for_expando_function as a single forward pass

Benchmark (vue-id.ts): 8.53ms → 6.57ms (~23% faster)

Test plan

  • cargo test -p oxc_isolated_declarations — all 20 tests pass
  • cargo clippy — no warnings
  • cargo bench -p oxc_benchmark --bench transformer -- isolated-declarations

🤖 Generated with Claude Code

@github-actions github-actions bot added A-isolated-declarations Isolated Declarations C-performance Category - Solution not expected to change functional behavior, only performance labels Feb 10, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

Merging this PR will improve performance by 7.77%

⚡ 1 improved benchmark
✅ 46 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation isolated-declarations[vue-id.ts] 56.6 ms 52.5 ms +7.77%

Comparing perf/isolated-declarations (6de0e78) with main (76c2bf8)2

Open in CodSpeed

Footnotes

  1. 3 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.

  2. No successful run was found on main (186a8ec) during the generation of this report, so 76c2bf8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Dunqing Dunqing marked this pull request as draft February 10, 2026 16:59
@Dunqing Dunqing force-pushed the perf/isolated-declarations branch 2 times, most recently from 33e63d4 to 4e70d87 Compare February 11, 2026 05:52
Copy link
Member Author

Dunqing commented Feb 11, 2026


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.

@Dunqing Dunqing force-pushed the perf/isolated-declarations branch from 4e70d87 to 6de0e78 Compare February 11, 2026 06:10
@Dunqing Dunqing marked this pull request as ready for review February 11, 2026 06:51
@Dunqing Dunqing requested review from Boshen and camc314 February 11, 2026 06:52
@Dunqing
Copy link
Member Author

Dunqing commented Feb 11, 2026

Much clearer than before

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Feb 11, 2026
Copy link
Member

Boshen commented Feb 11, 2026

Merge activity

…d Vec (#19221)

## Summary

- Eliminate redundant `transformed_spans: FxHashSet<Span>` by consolidating passthrough cases into `transformed_stmts`
- Replace `transformed_stmts: FxHashMap<Span, Statement>` with `Vec<Option<Statement>>` indexed by statement position for O(1) lookups
- Merge `get_assignable_properties_for_namespaces` into `report_error_for_expando_function` as a single forward pass

**Benchmark (vue-id.ts):** 8.53ms → 6.57ms (**~23% faster**)

## Test plan

- [x] `cargo test -p oxc_isolated_declarations` — all 20 tests pass
- [x] `cargo clippy` — no warnings
- [x] `cargo bench -p oxc_benchmark --bench transformer -- isolated-declarations`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the perf/isolated-declarations branch from 6de0e78 to e5baf60 Compare February 11, 2026 13:11
@graphite-app graphite-app bot merged commit e5baf60 into main Feb 11, 2026
21 checks passed
@graphite-app graphite-app bot deleted the perf/isolated-declarations branch February 11, 2026 13:18
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 11, 2026
camc314 pushed a commit that referenced this pull request Feb 16, 2026
### 🚀 Features

- 429d876 semantic: Assign ast node ids during semantic build (#19263)
(Boshen)
- ebb80b3 ast: Add `node_id` field to all AST struct nodes (#18138)
(Boshen)

### 🐛 Bug Fixes

- bfb15a3 semantic: Make multi_index_vec clone panic-safe (#19299)
(Boshen)
- 41c50a5 transformer: Ignore invalid JSX pragma identifiers (#19296)
(Boshen)
- deed3d8 transformer: Remove unnecessary trailing expression in object
rest spread assignment (#19259) (Boshen)
- 5bdaacc transformer: Propagate source spans for sourcemap correctness
(#19258) (Boshen)
- 3e0e5ba isolated-declarations: Align readonly class array initializer
diagnostics with tsc (#19218) (camc314)

### ⚡ Performance

- c169c77 syntax: Optimize `is_identifier_name_patched` (#19386)
(sapphi-red)
- aa1e1a8 allocator: Inline BitSet accessors (#19331) (Boshen)
- 5b90d46 semantic: Improve SoA with multi index vec (#19138) (Boshen)
- 99ce2a6 isolated_declarations: Mark all diagnostic functions as
`#[cold]` (#19279) (camc314)
- dd0220f transformer: Remove TS-only nodes earlier in
`enter_statements` (#19166) (Dunqing)
- e5baf60 isolated-declarations: Replace hash collections with
index-based Vec (#19221) (Dunqing)

### 📚 Documentation

- 569aa61 rust: Add missing rustdocs and remove missing_docs lint attrs
(#19306) (Boshen)
OskarLebuda pushed a commit to OskarLebuda/oxc that referenced this pull request Feb 17, 2026
…d Vec (oxc-project#19221)

## Summary

- Eliminate redundant `transformed_spans: FxHashSet<Span>` by consolidating passthrough cases into `transformed_stmts`
- Replace `transformed_stmts: FxHashMap<Span, Statement>` with `Vec<Option<Statement>>` indexed by statement position for O(1) lookups
- Merge `get_assignable_properties_for_namespaces` into `report_error_for_expando_function` as a single forward pass

**Benchmark (vue-id.ts):** 8.53ms → 6.57ms (**~23% faster**)

## Test plan

- [x] `cargo test -p oxc_isolated_declarations` — all 20 tests pass
- [x] `cargo clippy` — no warnings
- [x] `cargo bench -p oxc_benchmark --bench transformer -- isolated-declarations`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
OskarLebuda pushed a commit to OskarLebuda/oxc that referenced this pull request Feb 17, 2026
### 🚀 Features

- 429d876 semantic: Assign ast node ids during semantic build (oxc-project#19263)
(Boshen)
- ebb80b3 ast: Add `node_id` field to all AST struct nodes (oxc-project#18138)
(Boshen)

### 🐛 Bug Fixes

- bfb15a3 semantic: Make multi_index_vec clone panic-safe (oxc-project#19299)
(Boshen)
- 41c50a5 transformer: Ignore invalid JSX pragma identifiers (oxc-project#19296)
(Boshen)
- deed3d8 transformer: Remove unnecessary trailing expression in object
rest spread assignment (oxc-project#19259) (Boshen)
- 5bdaacc transformer: Propagate source spans for sourcemap correctness
(oxc-project#19258) (Boshen)
- 3e0e5ba isolated-declarations: Align readonly class array initializer
diagnostics with tsc (oxc-project#19218) (camc314)

### ⚡ Performance

- c169c77 syntax: Optimize `is_identifier_name_patched` (oxc-project#19386)
(sapphi-red)
- aa1e1a8 allocator: Inline BitSet accessors (oxc-project#19331) (Boshen)
- 5b90d46 semantic: Improve SoA with multi index vec (oxc-project#19138) (Boshen)
- 99ce2a6 isolated_declarations: Mark all diagnostic functions as
`#[cold]` (oxc-project#19279) (camc314)
- dd0220f transformer: Remove TS-only nodes earlier in
`enter_statements` (oxc-project#19166) (Dunqing)
- e5baf60 isolated-declarations: Replace hash collections with
index-based Vec (oxc-project#19221) (Dunqing)

### 📚 Documentation

- 569aa61 rust: Add missing rustdocs and remove missing_docs lint attrs
(oxc-project#19306) (Boshen)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-isolated-declarations Isolated Declarations 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

Comments