Skip to content

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Oct 20, 2025

Previous PR (#14767) implemented an initial ASCII check, but I forgot to add it to the other identifier checks as well. This now adds the fast path ASCII check to all of the branches for this rule.

In addition, we no longer need to call .to_string() to allocate for each identifier, we can simply do the exceptions check with &str.

This should greatly benefit large files which have lots of identifiers, but this will pretty much universally improve perf on every file since this rule runs on every identifier and almost every JS file has identifiers.

image

@github-actions github-actions bot added the A-linter Area - Linter label Oct 20, 2025
Copy link
Member Author

camchenry commented Oct 20, 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.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Oct 20, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 20, 2025

CodSpeed Performance Report

Merging #14821 will improve performances by 3.02%

Comparing 10-20-perf_linter_id-length_reduce_allocations_and_add_more_ascii_checks (04a78ee) with 10-20-perf_linter_use_precomputed_extension (deb2098)

Summary

⚡ 1 improvement
✅ 3 untouched
⏩ 33 skipped1

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
Instrumentation linter[binder.ts] 51.4 ms 49.8 ms +3.02%

Footnotes

  1. 33 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.

@camchenry camchenry marked this pull request as ready for review October 20, 2025 16:00
@camchenry camchenry requested a review from camc314 as a code owner October 20, 2025 16:00
@graphite-app graphite-app bot changed the base branch from 10-20-perf_linter_use_precomputed_extension to graphite-base/14821 October 20, 2025 16:50
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Oct 20, 2025
Copy link
Contributor

camc314 commented Oct 20, 2025

Merge activity

@graphite-app graphite-app bot changed the base branch from graphite-base/14821 to main October 20, 2025 16:54
…ks (#14821)

Previous PR (#14767) implemented an initial ASCII check, but I forgot to add it to the other identifier checks as well. This now adds the fast path ASCII check to all of the branches for this rule.

In addition, we no longer need to call `.to_string()` to allocate for each identifier, we can simply do the exceptions check with `&str`.

This should greatly benefit large files which have lots of identifiers, but this will pretty much universally improve perf on every file since this rule runs on every identifier and almost every JS file has identifiers.

<img width="714" height="535" alt="image" src="https://github.com/user-attachments/assets/f67a43e8-0e91-4f6d-805b-a031f9881c74" />
@graphite-app graphite-app bot force-pushed the 10-20-perf_linter_id-length_reduce_allocations_and_add_more_ascii_checks branch from 04a78ee to b8f8ce5 Compare October 20, 2025 16:55
@graphite-app graphite-app bot merged commit b8f8ce5 into main Oct 20, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 10-20-perf_linter_id-length_reduce_allocations_and_add_more_ascii_checks branch October 20, 2025 16:59
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter 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