perf(linter/plugins): reduce operations in binary search#20490
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 21, 2026
Merged
Conversation
This was referenced Mar 18, 2026
This was referenced Mar 18, 2026
Member
Author
This was referenced Mar 18, 2026
c659d44 to
66d228c
Compare
569fde7 to
5c85a67
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a micro-optimization in the linter’s source-location utilities by changing the binary search midpoint calculation used when converting an offset into a line/column position.
Changes:
- Replace midpoint computation from division-based floor to bitshift-based midpoint in
getLineColumnFromOffsetUnchecked.
5c85a67 to
cea62d4
Compare
66d228c to
847014b
Compare
This was referenced Mar 18, 2026
Contributor
Merge activity
|
cea62d4 to
7de6e14
Compare
d825833 to
72d4da3
Compare
7de6e14 to
2be5b0a
Compare
Tiny optimization. Use 1 less operation in binary search when converting offset to line-column pair.
72d4da3 to
9cfc312
Compare
2be5b0a to
8729614
Compare
Base automatically changed from
om/03-17-perf_linter_plugins_reduce_allocations_for_tokens_and_comments_with_accessed_loc_
to
main
March 21, 2026 12:52
This was referenced Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Tiny optimization. Use 1 less operation in binary search when converting offset to line-column pair.