Skip to content
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

Modify BKTree.Lookup to pass the threshold to GetEditDistance when there will not be a need for the actual edit distance #70567

Merged

Conversation

ToddGrun
Copy link
Contributor

GetEditDistance has various optimizations that are used when a threshold is passed in that weren't being allowed to execute when called from BKTree.Lookup as it needed the precise edit distance. However, this method only needs the precise edit distance if it has edges to later inspect.

I tested this out locally adding stopwatch calls in Lookup with both the old and new code and saw a 25-30% reduction in overall time spent in Lookup with this change.

…old is passed in that weren't being allowed to execute when called from BKTree.Lookup as it needed the precise edit distance. However, this method only needs the precise edit distance if it has edges to later inspect.

I tested this out locally adding stopwatch calls in Lookup with both the old and new code and saw a 25-30% reduction in overall time spent in Lookup with this change.
@ToddGrun ToddGrun requested a review from a team as a code owner October 26, 2023 04:11
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 26, 2023
@ToddGrun
Copy link
Contributor Author

original PR that I mucked up via a bad rebase: #70525

@ToddGrun ToddGrun merged commit 845ee3b into dotnet:main Oct 26, 2023
22 of 24 checks passed
@ghost ghost added this to the Next milestone Oct 26, 2023
@jjonescz jjonescz modified the milestones: Next, 17.9 P1 Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants