-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[file-search] improve results obtained when performing file search #6642
Conversation
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.
So the idea is "not stop the search until the number of exact matches exceeds the limit".
The code lowers the "worst-case performance", and should not have major impacts to the "average case performance". I am OK with this change.
Yes, the general idea is to use the limit only for the It improves the results obtained while also not being too much of a radical change. |
@lmcbout do you mind trying out this pull request for me when you get the chance? |
I will test it |
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.
LGTM
Code wise: ok
Testing on Ubuntu and Chrome: works fine, performance is good
Matching result: Great
If possible, I'd really like to get more opinions/reviews on this pull request before merging. |
I'm fine to try. |
Fixes #5636 - improve the results obtained when performing the `file-search`. - exact results are now prioritized over fuzzy results, leading to a more consistent experience. - only the limit of results is sent over the wire. Signed-off-by: vince-fugnitto <[email protected]>
57951df
to
6ed0e91
Compare
Sounds good, we can try to see if the behavior is better, and if anything it is always possible to rollback/revert the changes as they are in history. |
What it does
Fixes #5636
Description:
The current logic of the
file-search
meant that fuzzy results were being returned over exact results due to the limit. This PR quickly addresses that issue by ensuring that exact matches are prioritized, and thus returns better results. The PR has been tested with large workspaces (and even multi-root workspaces) and the performance stayed largely identical. There is likely to be a tradeoff of performance for better results which in the end I believe users would appreciate.Implementation
The idea is to
cancel
the search if theexact
matches hits the allowed limit.Only the limit of results is sent over the wire.
How to test
file-search
on a large workspace (or multi-root workspace)os.ts
)Review checklist
Reminder for reviewers
Signed-off-by: vince-fugnitto [email protected]