SIMD-accelerated byte and substring search for Rust
open sourceMIT OR Unlicensefree
memchr is a Rust library of heavily optimised string search primitives: searching for one, two or three bytes forwards or backwards, and forward and reverse substring search (memmem), on raw &[u8] regardless of encoding. It uses SIMD on x86_64 (SSE2, or AVX2 when detected at run time), aarch64 and wasm32, falls back to portable code elsewhere, and works in no_std crates. It's by Andrew Gallant (BurntSushi).
Problems it solves
- find a byte quickly in a large buffer in Rust
- fast substring search over bytes in Rust
- SIMD string search in a no_std crate
Features
- 1, 2 and 3 byte search, forward and reverse
- memmem substring search
- SIMD on x86_64, aarch64 and wasm32
- no_std support
