-
-
Notifications
You must be signed in to change notification settings - Fork 714
perf(linter/plugins): use binary search #14778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
bb606a9 to
0a1d767
Compare
There was a problem hiding this 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 optimizes the comment traversal functions in the linter's comments plugin by replacing linear search algorithms with binary search. This improves performance from O(n) to O(log n) for finding comments relative to AST nodes.
- Binary search implementation for finding comments before, after, and inside nodes
- Optimization of the
commentsExistBetweenfunction with binary search - Improved algorithmic efficiency while maintaining the same functionality
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
c3e8ba4 to
10f1ed5
Compare
camc314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
Part of #14564. Binary search is used to traverse the comments array wherever possible.
getCommentsBeforegetCommentsAftergetCommentsInsidecommentsExistBetween