Expand description
Parallel Mergeing of two Sorted Arrays using rayon.
This crate provides the highly parallelized algorithm to merge two sorted slices in the following functions.
§Benchmark Results
The benchmark runs the sequential and parallel versions on Intel
i7-10750H CPU (12 hyperthreads) using release profile. It is
tested on two sorted u64 arrays. The parallel version is shown
to be ~6 times fater than the sequential counterpart.
| per array len | sequential | parallel |
|---|---|---|
| 10^6 | 14.56987ms | 2.219912ms |
| 10^7 | 139.675856ms | 23.363867ms |
| 10^8 | 1.427501286s | 325.121204ms |
Functions§
- par_
merge - Merges two sorted slices in parallel.
- par_
merge_ by - Merges two sorted slices in parallel with a custom comparison function.
- par_
merge_ by_ key - Merges two sorted slices in parallel with a custom key function.
- seq_
merge - Sequentially merges two sorted slices.
- seq_
merge_ by - Sequentially merges two sorted slices with a custom comparison function.
- seq_
merge_ by_ key - Sequentially merges two sorted slices with a custom key function.