Skip to content

perf(napi/parser, oxlint/plugins): shorten deserializer for WithClause#20575

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-02-perf_napi_parser_oxlint_plugins_shorten_deserializer_for_withclause_
Mar 20, 2026
Merged

perf(napi/parser, oxlint/plugins): shorten deserializer for WithClause#20575
graphite-app[bot] merged 1 commit intomainfrom
om/03-02-perf_napi_parser_oxlint_plugins_shorten_deserializer_for_withclause_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Mar 20, 2026

Small optimization to ESTree serialization and raw transfer. Shave off a little work when serializing/deserializing WithClause.

@github-actions github-actions bot added A-linter Area - Linter A-parser Area - Parser A-cli Area - CLI A-ast Area - AST A-linter-plugins Area - Linter JS plugins C-performance Category - Solution not expected to change functional behavior, only performance labels Mar 20, 2026
Copy link
Copy Markdown
Member Author


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 changes, fast-track this PR to the front of the merge queue

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.

@overlookmotel overlookmotel marked this pull request as ready for review March 20, 2026 20:21
@overlookmotel overlookmotel requested a review from camc314 as a code owner March 20, 2026 20:21
Copilot AI review requested due to automatic review settings March 20, 2026 20:21
@overlookmotel overlookmotel self-assigned this Mar 20, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 20, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/03-02-perf_napi_parser_oxlint_plugins_shorten_deserializer_for_withclause_ (5723ee4) with main (33993fe)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 (d63c80e) during the generation of this report, so 33993fe was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes WithClause handling in the AST transfer pipeline by avoiding unnecessary span/range materialization during (de)serialization, reducing work in both Rust ESTree serialization and JS raw-transfer deserializers.

Changes:

  • Remove WithClause span serialization from Rust ESTree output.
  • Simplify JS raw-transfer deserializers to stop reading/constructing start/end/range for WithClause.
  • Remove start/end accessors and JSON fields from the lazy raw-transfer WithClause constructor.

Reviewed changes

Copilot reviewed 1 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
napi/parser/src-js/generated/lazy/constructors.js Drops WithClause start/end getters and omits them from toJSON() to reduce lazy materialization work.
napi/parser/src-js/generated/deserialize/ts_range_parent.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/ts_range.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/ts_parent.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/ts.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/js_range_parent.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/js_range.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/js_parent.js Simplifies deserializeWithClause to only return attributes.
napi/parser/src-js/generated/deserialize/js.js Simplifies deserializeWithClause to only return attributes.
crates/oxc_ast/src/generated/derive_estree.rs Removes serialize_span(self.span) from WithClause ESTree serialization.
crates/oxc_ast/src/ast/js.rs Marks WithClause.span with #[estree(skip)] to avoid emitting it.
apps/oxlint/src-js/generated/deserialize.js Simplifies deserializeWithClause to only return attributes in oxlint’s raw-transfer deserializer.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 20, 2026
Copy link
Copy Markdown
Member Author

overlookmotel commented Mar 20, 2026

Merge activity

…se` (#20575)

Small optimization to ESTree serialization and raw transfer. Shave off a little work when serializing/deserializing `WithClause`.
@graphite-app graphite-app bot force-pushed the om/03-02-perf_napi_parser_oxlint_plugins_shorten_deserializer_for_withclause_ branch from 5723ee4 to d176ecc Compare March 20, 2026 20:40
@graphite-app graphite-app bot merged commit d176ecc into main Mar 20, 2026
25 checks passed
@graphite-app graphite-app bot deleted the om/03-02-perf_napi_parser_oxlint_plugins_shorten_deserializer_for_withclause_ branch March 20, 2026 20:44
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 20, 2026
costajohnt pushed a commit to costajohnt/oxc that referenced this pull request Mar 22, 2026
…se` (oxc-project#20575)

Small optimization to ESTree serialization and raw transfer. Shave off a little work when serializing/deserializing `WithClause`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins 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