项目作者: saschagrunert

项目描述 :
A fast byte slice comparison library
高级语言: Rust
项目地址: git://github.com/saschagrunert/fastcmp.git
创建时间: 2017-01-30T15:36:49Z
项目社区:https://github.com/saschagrunert/fastcmp

开源协议:MIT License

下载


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

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

Benchmarks

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

  1. test fast_compare_equal ... bench: 14 ns/iter (+/- 9) = 18285 MB/s
  2. test fast_compare_unequal ... bench: 14 ns/iter (+/- 0) = 18285 MB/s
  3. test slice_compare_equal ... bench: 35 ns/iter (+/- 29) = 7314 MB/s
  4. 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.