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:
parent
c5e8677a37
commit
d95d65c6a3
1 changed files with 1 additions and 1 deletions
|
|
@ -31,6 +31,6 @@ pub fn sort_strings(options: Options, strings: Vec<String>) -> Vec<Match> {
|
||||||
})
|
})
|
||||||
.filter(|m| m.score > 25)
|
.filter(|m| m.score > 25)
|
||||||
.collect::<Vec<Match>>();
|
.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
|
matches
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue