-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve fuzzy match performance and fix corner case that omits results (
#22524) * Removes `max_results` from the matcher interface as this is better dealt with in consumers once all results are known. The current implementation was quite inefficient as it was using binary search to find insertion points and then doing an insert which copies the entire suffix each time. * There was a corner case where if the binary search found a match candidate with the same score, it was dropped. Now fixed. * Uses of `util::extend_sorted` when merging results from worker threads also repeatedly uses binary search and insertion which copies the entire suffix. A followup will remove that and its usage. * Adds `util::truncate_to_bottom_n_sorted_by` which uses quickselect + sort to efficiently get a sorted count limited result. * Improves interface of Matcher::match_candidates by providing the match positions to the build function. This allows for removal of the `Match` trait. It also fixes a bug where the Match's own Ord wasn't being used, which seems relevant to PathMatch for cases where scores are the same. Release Notes: - N/A
- Loading branch information
Showing
4 changed files
with
50 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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