Skip to content

perf(parser): avoid vec clone in parse_heritage_clause#20665

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/03-23-perf_parser_avoid_vec_clone
Mar 24, 2026
Merged

perf(parser): avoid vec clone in parse_heritage_clause#20665
graphite-app[bot] merged 1 commit intomainfrom
c/03-23-perf_parser_avoid_vec_clone

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Mar 23, 2026

note: no perf improvement expected as this path isn't taken in the parser benchmarks

Copy link
Copy Markdown
Contributor Author

camc314 commented Mar 23, 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.

@github-actions github-actions bot added A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance labels Mar 23, 2026
@camc314 camc314 marked this pull request as ready for review March 23, 2026 21:22
Copilot AI review requested due to automatic review settings March 23, 2026 21:22
@camc314 camc314 changed the title perf(parser): avoid vec clone perf(parser): avoid vec clone in parse_heritage_clause Mar 23, 2026
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 removes an unnecessary re-allocation when parsing a TypeScript implements clause in class heritage parsing, simplifying the code path and avoiding an extra Vec construction.

Changes:

  • Replace self.ast.vec_from_iter(self.parse_ts_implements_clause()) with direct use of the returned Vec from parse_ts_implements_clause().

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 23, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing c/03-23-perf_parser_avoid_vec_clone (0373c67) with main (2917bb2)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 (6b5cd8c) during the generation of this report, so 2917bb2 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@camc314 camc314 changed the title perf(parser): avoid vec clone in parse_heritage_clause perf(parser): avoid vec clone in parse_heritage_clause Mar 23, 2026
@camc314 camc314 force-pushed the c/03-23-perf_parser_avoid_vec_clone branch from 2d352a9 to 0373c67 Compare March 23, 2026 21:33
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 24, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Mar 24, 2026

Merge activity

note: no perf improvement expected as this path isn't taken in the parser benchmarks
@graphite-app graphite-app bot force-pushed the c/03-23-perf_parser_avoid_vec_clone branch from 0373c67 to 2b2794b Compare March 24, 2026 04:01
@graphite-app graphite-app bot merged commit 2b2794b into main Mar 24, 2026
27 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 24, 2026
@graphite-app graphite-app bot deleted the c/03-23-perf_parser_avoid_vec_clone branch March 24, 2026 04:04
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