Use Rayon for sorting as well

- For completeness, but also for additional performance when there are
  extremely large numbers of results, use `par_sort_unstable_by()` for
  sorting the results. For most sane result sets this will not represent
  a significant speedup (for the Kubernetes benchmark it's around 1%)
  but as the set to be sorted grows the impact would be larger.
This commit is contained in:
Xymist 2022-08-26 16:36:34 +01:00
parent c5e8677a37
commit d95d65c6a3

View file

@ -31,6 +31,6 @@ pub fn sort_strings(options: Options, strings: Vec<String>) -> Vec<Match> {
})
.filter(|m| m.score > 25)
.collect::<Vec<Match>>();
matches.sort_by(|a, b| a.score.cmp(&b.score));
matches.par_sort_unstable_by(|a, b| a.score.cmp(&b.score));
matches
}