3 releases (stable)

Uses old Rust 2015

1.0.1 Feb 1, 2017
0.1.0 Jan 30, 2017

#2443 in Algorithms

Download history 15/week @ 2024-05-20 15/week @ 2024-05-27 16/week @ 2024-06-03 43/week @ 2024-06-10 60/week @ 2024-06-17 70/week @ 2024-06-24 41/week @ 2024-07-01 42/week @ 2024-07-08 56/week @ 2024-07-15 48/week @ 2024-07-22 70/week @ 2024-07-29 73/week @ 2024-08-05 33/week @ 2024-08-12 34/week @ 2024-08-19 34/week @ 2024-08-26 64/week @ 2024-09-02

168 downloads per month
Used in 2 crates (via pi_store)

MIT license

7KB
72 lines

fastcmp

Build Status Build status Coverage Status master doc fastcmp License MIT Crates.io doc.rs

A fast byte slice comparison library

The library is intended to provide a faster byte slice comparison than the standard library. Also raw string literals b"like this" are compareable this way. It also supports simd comparisons by enabling the feature simd_support in the Cargo.toml.

Example usage

use fastcmp::Compare;

let vec = vec![1, 2, 3, 4, 5];
assert!(vec.feq(&[1, 2, 3, 4, 5]));

Benchmarks

The benchmarking results for comparison of two &[u8] with a size of 256:

test fast_compare_equal    ... bench:          14 ns/iter (+/- 9) = 18285 MB/s
test fast_compare_unequal  ... bench:          14 ns/iter (+/- 0) = 18285 MB/s
test slice_compare_equal   ... bench:          35 ns/iter (+/- 29) = 7314 MB/s
test slice_compare_unequal ... bench:          37 ns/iter (+/- 3) = 6918 MB/s

Contributing

You want to contribute to this project? Wow, thanks! So please just fork it and send me a pull request.

No runtime deps