#sorting #simd #performance #primitive-integer

vqsort-rs

Rust bindings for the Google Highway's vectorized quicksort

2 unstable releases

0.2.0 May 22, 2024
0.1.0 May 21, 2024

#2577 in Algorithms

43 downloads per month

Apache-2.0 OR BSD-3-Clause

10KB
190 lines

vqsort-rs

Rust bindings for the Google Highway's vectorized quicksort.

The sorting algorithm is very fast as seen in a research and far outperforms the standard Rust sort_unstable. However, it can only be used with primitive integers and floats.

Example

let mut data = [5, 3, 8, 0, -100];
vqsort_rs::sort(&mut data);
assert_eq!(data, [-100, 0, 3, 5, 8]);

vqsort_rs::sort_descending(&mut data);
assert_eq!(data, [8, 5, 3, 0, -100]);

Miri

When testing with Miri, the crate resorts to sort_unstable, since Miri doesn't support FFI.


lib.rs:

Rust bindings for the Google Highway's vectorized quicksort.

Dependencies

~0–600KB
~13K SLoC