Skip to content

Comments

ci(benchmarks/lexer): fix lexer benchmark#15517

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-09-ci_benchmarks_lexer_fix_lexer_benchmark
Nov 9, 2025
Merged

ci(benchmarks/lexer): fix lexer benchmark#15517
graphite-app[bot] merged 1 commit intomainfrom
11-09-ci_benchmarks_lexer_fix_lexer_benchmark

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 9, 2025

Fix a bug in lexer benchmark. SourceCleaner checks that lexer doesn't produce any errors on the cleaned source. But it wasn't using exactly the same code for lexing as the benchmark itself - it wasn't using Lexer#first_token to get the first token. Fix that.

Copy link
Member Author

overlookmotel commented Nov 9, 2025


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 hot fixes, skip the queue and merge this PR next

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 November 9, 2025 14:13
Copilot AI review requested due to automatic review settings November 9, 2025 14:13
@overlookmotel overlookmotel self-assigned this Nov 9, 2025
@overlookmotel overlookmotel added C-bug Category - Bug A-parser Area - Parser labels Nov 9, 2025
Copy link
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 refactors the lexer benchmark code by extracting the common lexing logic into a reusable lex_whole_file helper function. The refactoring aims to reduce code duplication and improve maintainability.

Key Changes:

  • Extracted common lexer iteration logic into a new lex_whole_file function with #[inline(always)] attribute
  • Updated both the benchmark loop and SourceCleaner::clean method to use the new helper function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 9, 2025

CodSpeed Performance Report

Merging #15517 will not alter performance

Comparing 11-09-ci_benchmarks_lexer_fix_lexer_benchmark (c8de3e4) with main (2f0518d)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (bc2e35d) during the generation of this report, so 2f0518d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel force-pushed the 11-09-ci_benchmarks_lexer_fix_lexer_benchmark branch from 28862fd to 1977909 Compare November 9, 2025 14:23
@overlookmotel overlookmotel marked this pull request as draft November 9, 2025 15:08
@overlookmotel overlookmotel force-pushed the 11-09-ci_benchmarks_lexer_fix_lexer_benchmark branch from 1977909 to c8de3e4 Compare November 9, 2025 15:09
@overlookmotel overlookmotel assigned Boshen and unassigned overlookmotel Nov 9, 2025
@overlookmotel overlookmotel marked this pull request as ready for review November 9, 2025 16:25
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 9, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 9, 2025

Merge activity

Fix a bug in lexer benchmark. `SourceCleaner` checks that lexer doesn't produce any errors on the cleaned source. But it wasn't using exactly the same code for lexing as the benchmark itself - it wasn't using `Lexer#first_token` to get the first token. Fix that.
@graphite-app graphite-app bot force-pushed the 11-09-ci_benchmarks_lexer_fix_lexer_benchmark branch from c8de3e4 to 4a53d09 Compare November 9, 2025 16:45
@graphite-app graphite-app bot merged commit 4a53d09 into main Nov 9, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 11-09-ci_benchmarks_lexer_fix_lexer_benchmark branch November 9, 2025 16:51
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants