Skip to content

perf(parser): refactor out LexerContext#21275

Merged
camc314 merged 3 commits intooxc-project:mainfrom
ulrichstark:perf(parser)--refactor-out-`LexerContext`
Apr 14, 2026
Merged

perf(parser): refactor out LexerContext#21275
camc314 merged 3 commits intooxc-project:mainfrom
ulrichstark:perf(parser)--refactor-out-`LexerContext`

Conversation

@ulrichstark
Copy link
Copy Markdown
Contributor

@ulrichstark ulrichstark commented Apr 9, 2026

Makes LexerContext obsolete by refactoring expect_jsx_attribute_value to advance_for_jsx_attribute_value and adding code paths for lexing jsx attribute values. This has the effect that all code related to LexerContext, the code path inside macro handle_string_literal and the redundant Kind::Eq check is gone.

@github-actions github-actions Bot added A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance labels Apr 9, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 9, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing ulrichstark:perf(parser)--refactor-out-LexerContext (df0a77a) with main (cffdc2e)

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.

@camc314 camc314 merged commit da3cc16 into oxc-project:main Apr 14, 2026
34 checks passed
@ulrichstark ulrichstark deleted the perf(parser)--refactor-out-`LexerContext` branch April 14, 2026 21:11
Dunqing added a commit that referenced this pull request Apr 16, 2026
### 💥 BREAKING CHANGES

- 24fb7eb allocator: [**BREAKING**] Rename `Box` and `Vec` methods
(#21395) (overlookmotel)

### 🚀 Features

- ce5072d parser: Support `turbopack` magic comments (#20803) (Kane
Wang)
- f5deb55 napi/transform: Expose `optimizeConstEnums` and
`optimizeEnums` options (#21388) (Dunqing)
- 24b03de data_structures: Introduce `NonNullConst` and `NonNullMut`
pointer types (#21425) (overlookmotel)

### 🐛 Bug Fixes

- d7a359a ecmascript: Treat update expressions as unconditionally
side-effectful (#21456) (Dunqing)
- 56af2f4 transformer/async-to-generator: Correct scope of inferred
named FE in async-to-generator (#21458) (Dunqing)
- b3ed467 minifier: Avoid illegal `var;` when folding unused arguments
copy loop (#21421) (fazba)
- b0e8f13 minifier: Preserve `var` inside `catch` with same-named
parameter (#21366) (Dunqing)
- 4fb73a7 transformer/typescript: Preserve execution order for accessor
with `useDefineForClassFields: false` (#21369) (Dunqing)

### ⚡ Performance

- da3cc16 parser: Refactor out `LexerContext` (#21275) (Ulrich Stark)

### 📚 Documentation

- c5b19bb allocator: Reformat comments in `Arena` (#21448)
(overlookmotel)
- 091e88e lexer: Update doc comment about perf benefit of reading
through references (#21423) (overlookmotel)
- 922cbee allocator: Remove references to "bump" from comments (#21397)
(overlookmotel)

Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser 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