Skip to content

perf(ast_tools): reduce data passing between functions#20579

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

perf(ast_tools): reduce data passing between functions#20579
graphite-app[bot] merged 1 commit intomainfrom
om/02-15-perf_ast_tools_reduce_data_passing_between_functions

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Mar 20, 2026

Refactor ast_tools. Simplify code by storing is_meta flag in StructSkeleton and EnumSkeleton types, instead of passing around a bool separately.

Copy link
Copy Markdown
Member Author

overlookmotel commented Mar 20, 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 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.

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

Refactors tasks/ast_tools parsing to reduce parallel data plumbing by embedding the is_meta flag inside StructSkeleton / EnumSkeleton and exposing common accessors on Skeleton.

Changes:

  • Add Skeleton::name() and Skeleton::is_meta() accessors and store is_meta on both skeleton variants.
  • Simplify load_file to return Vec<Skeleton> (instead of (name, skeleton, is_meta) tuples) via a parse_item helper.
  • Update phase-1 collection logic and downstream parsing destructures to align with the new skeleton shapes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tasks/ast_tools/src/parse/skeleton.rs Adds name()/is_meta() on Skeleton and embeds is_meta into struct/enum skeleton types.
tasks/ast_tools/src/parse/load.rs Refactors file loading/parsing to return Skeleton directly and centralizes item parsing.
tasks/ast_tools/src/parse/mod.rs Updates phase-1 merging logic to use Skeleton accessors and new return type from load_file.
tasks/ast_tools/src/parse/parse.rs Updates skeleton destructuring patterns to ignore the new is_meta field.

@overlookmotel overlookmotel self-assigned this Mar 20, 2026
@overlookmotel overlookmotel force-pushed the om/02-14-perf_ast_tools_parse_files_in_parallel branch from 93f5bde to c66b283 Compare March 20, 2026 22:02
@overlookmotel overlookmotel force-pushed the om/02-15-perf_ast_tools_reduce_data_passing_between_functions branch from 677b327 to b94ce6b Compare March 20, 2026 22:02
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 20, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Mar 20, 2026

Merge activity

Refactor `ast_tools`. Simplify code by storing `is_meta` flag in `StructSkeleton` and `EnumSkeleton` types, instead of passing around a `bool` separately.
@graphite-app graphite-app bot force-pushed the om/02-14-perf_ast_tools_parse_files_in_parallel branch from c66b283 to 82a136f Compare March 20, 2026 22:16
@graphite-app graphite-app bot requested a review from camc314 as a code owner March 20, 2026 22:16
@graphite-app graphite-app bot force-pushed the om/02-15-perf_ast_tools_reduce_data_passing_between_functions branch from b94ce6b to b4da52f Compare March 20, 2026 22:17
Base automatically changed from om/02-14-perf_ast_tools_parse_files_in_parallel to main March 20, 2026 22:23
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 20, 2026
@graphite-app graphite-app bot merged commit b4da52f into main Mar 20, 2026
24 checks passed
@graphite-app graphite-app bot deleted the om/02-15-perf_ast_tools_reduce_data_passing_between_functions branch March 20, 2026 22:24
costajohnt pushed a commit to costajohnt/oxc that referenced this pull request Mar 22, 2026
…0579)

Refactor `ast_tools`. Simplify code by storing `is_meta` flag in `StructSkeleton` and `EnumSkeleton` types, instead of passing around a `bool` separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools 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