-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
932: Add par_sort_by_cached_key r=cuviper a=cuviper This is a port of the standard library's `slice::sort_by_cached_key` as `ParallelSliceMut::par_sort_by_cached_key`. We can do the initial key-caching indexed `collect` in parallel, and then use `par_sort_unstable` on that, but the final rearrangement on the original slice is still sequential. The new benchmarks test integers with a `to_string` key, and it looks great on my Ryzen 7 5800X: ``` test sort::par_sort_by_cached_key ... bench: 3,464,639 ns/iter (+/- 253,378) = 115 MB/s test sort::par_sort_by_key ... bench: 6,865,096 ns/iter (+/- 204,145) = 58 MB/s test sort::par_sort_unstable_by_key ... bench: 13,346,235 ns/iter (+/- 1,966,048) = 29 MB/s ``` While I was in the neighborhood, I also updated documentation changes in the other sorting methods that were ported from the standard library. Co-authored-by: Josh Stone <[email protected]>
- Loading branch information
Showing
2 changed files
with
196 additions
and
34 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