Skip to content

perf(parser): remove a lookahead from eat_modifiers_before_declaration#20755

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-25-perf_parser_remove_a_lookahead_from_eat_modifiers_before_declaration_
Mar 26, 2026
Merged

perf(parser): remove a lookahead from eat_modifiers_before_declaration#20755
graphite-app[bot] merged 1 commit intomainfrom
om/03-25-perf_parser_remove_a_lookahead_from_eat_modifiers_before_declaration_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Mar 25, 2026

Remove an unnecessary lookahead from eat_modifiers_before_declaration. The loop below already does this check. There's no point doing it twice, especially as lookaheads aren't so cheap.

Copy link
Copy Markdown
Member Author

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 25, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing om/03-25-perf_parser_remove_a_lookahead_from_eat_modifiers_before_declaration_ (4e8b817) with main (d8e9d01)2

Open in CodSpeed

Footnotes

  1. 8 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 (4e8b817) during the generation of this report, so d8e9d01 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel marked this pull request as ready for review March 25, 2026 22:03
Copilot AI review requested due to automatic review settings March 25, 2026 22:03
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 a redundant modifier lookahead in the parser’s eat_modifiers_before_declaration, relying on the existing while self.at_modifier() loop condition to avoid doing the same lookahead twice.

Changes:

  • Removed an early at_modifier() check/return in eat_modifiers_before_declaration to eliminate duplicate lookahead work.

@overlookmotel overlookmotel force-pushed the om/03-25-perf_parser_remove_a_lookahead_from_eat_modifiers_before_declaration_ branch from c0f2445 to aac33f9 Compare March 25, 2026 22:13
@overlookmotel overlookmotel force-pushed the om/03-25-refactor_parser_nest_modifiers_types_in_modules branch from 6bd2ce0 to 793034c Compare March 25, 2026 22:13
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Mar 26, 2026

Merge activity

  • Mar 26, 1:13 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 26, 1:13 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #20739.
  • Mar 26, 1:13 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #20739.
  • Mar 26, 1:28 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 26, 1:29 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 26, 1:33 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #20740.
  • Mar 26, 1:33 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #20740.
  • Mar 26, 1:33 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 26, 1:34 PM UTC: The merge label '0-merge' was removed. This PR will no longer be merged by the Graphite merge queue
  • Mar 26, 1:36 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 26, 1:37 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 26, 1:52 PM UTC: Merged by the Graphite merge queue.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026
@graphite-app graphite-app bot force-pushed the om/03-25-refactor_parser_nest_modifiers_types_in_modules branch from 793034c to 5f64ec6 Compare March 26, 2026 13:40
graphite-app bot pushed a commit that referenced this pull request Mar 26, 2026
…on` (#20755)

Remove an unnecessary lookahead from `eat_modifiers_before_declaration`. The loop below already does this check. There's no point doing it twice, especially as lookaheads aren't so cheap.
@graphite-app graphite-app bot force-pushed the om/03-25-perf_parser_remove_a_lookahead_from_eat_modifiers_before_declaration_ branch from aac33f9 to f4f8674 Compare March 26, 2026 13:41
…on` (#20755)

Remove an unnecessary lookahead from `eat_modifiers_before_declaration`. The loop below already does this check. There's no point doing it twice, especially as lookaheads aren't so cheap.
@graphite-app graphite-app bot force-pushed the om/03-25-refactor_parser_nest_modifiers_types_in_modules branch from 5f64ec6 to 448aae5 Compare March 26, 2026 13:44
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.

3 participants