Skip to content

perf(parser): simplify getting span of identifiers and literals#11323

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-27-perf_parser_simplify_getting_span_of_identifiers_and_literals
May 27, 2025
Merged

perf(parser): simplify getting span of identifiers and literals#11323
graphite-app[bot] merged 1 commit intomainfrom
05-27-perf_parser_simplify_getting_span_of_identifiers_and_literals

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 27, 2025

Small optimization. For identifiers and literals, the span of the AST node is the same as the span of the Token. So just get the whole span from the Token in one access, and avoid the dance of assembling the span by calling start_span and then end_span.

@github-actions github-actions bot added A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance labels May 27, 2025
Copy link
Member Author

overlookmotel commented May 27, 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 May 27, 2025 12:43
@codspeed-hq
Copy link

codspeed-hq bot commented May 27, 2025

CodSpeed Instrumentation Performance Report

Merging #11323 will not alter performance

Comparing 05-27-perf_parser_simplify_getting_span_of_identifiers_and_literals (14cb3c7) with 05-27-perf_parser_check_identifier_match_on_kind_not_str_ (2372f00)

Summary

✅ 38 untouched benchmarks

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 27, 2025
Copy link
Member

Boshen commented May 27, 2025

Merge activity

Small optimization. For identifiers and literals, the span of the AST node is the same as the span of the `Token`. So just get the whole span from the `Token` in one access, and avoid the dance of assembling the span by calling `start_span` and then `end_span`.
@graphite-app graphite-app bot force-pushed the 05-27-perf_parser_check_identifier_match_on_kind_not_str_ branch from a18b48b to 2372f00 Compare May 27, 2025 15:19
@graphite-app graphite-app bot force-pushed the 05-27-perf_parser_simplify_getting_span_of_identifiers_and_literals branch from 6c36d35 to 14cb3c7 Compare May 27, 2025 15:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 27, 2025
Base automatically changed from 05-27-perf_parser_check_identifier_match_on_kind_not_str_ to main May 27, 2025 15:28
@graphite-app graphite-app bot merged commit 14cb3c7 into main May 27, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 05-27-perf_parser_simplify_getting_span_of_identifiers_and_literals branch May 27, 2025 15:28
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