#排序 #并行 #rayon

bitonic

使用 rayon 实现的并行 bitonic 排序

2 个不稳定版本

使用旧的 Rust 2015

0.2.0 2017 年 10 月 24 日
0.1.0 2017 年 10 月 24 日

25#sorted

每月 25 次下载

MIT/Apache

11KB
243

Rust 中的并行 bitonic 排序

使用 rayon 实现并行,对于短切片回退到 unstable_sort。目前只适用于 2 的幂次方数组。

在 4 核(8 线程)Kaby Lake 3.8GHz 笔记本上的基准测试

test bitonic_128          ... bench:       1,110 ns/iter (+/- 79)
test bitonic_32768        ... bench:     554,374 ns/iter (+/- 28,342)
test bitonic_65536        ... bench:   1,211,296 ns/iter (+/- 132,500)
test rayon_stable_128     ... bench:       1,743 ns/iter (+/- 85)
test rayon_stable_32768   ... bench:     445,732 ns/iter (+/- 22,396)
test rayon_stable_65536   ... bench:     884,402 ns/iter (+/- 30,717)
test rayon_unstable_128   ... bench:       1,066 ns/iter (+/- 148)
test rayon_unstable_32768 ... bench:     402,498 ns/iter (+/- 17,377)
test rayon_unstable_65536 ... bench:     748,362 ns/iter (+/- 41,358)
test std_stable_128       ... bench:       1,718 ns/iter (+/- 98)
test std_stable_32768     ... bench:   1,231,475 ns/iter (+/- 45,878)
test std_stable_65536     ... bench:   2,618,005 ns/iter (+/- 114,323)
test std_unstable_128     ... bench:       1,185 ns/iter (+/- 112)
test std_unstable_32768   ... bench:     895,112 ns/iter (+/- 80,483)
test std_unstable_65536   ... bench:   1,774,216 ns/iter (+/- 48,544)

依赖项

~1.5MB
~26K SLoC