All Projects → cloudflare → sliceslice-rs

cloudflare / sliceslice-rs

Licence: MIT license
A fast implementation of single-pattern substring search using SIMD acceleration.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to sliceslice-rs

ultra-sort
DSL for SIMD Sorting on AVX2 & AVX512
Stars: ✭ 29 (-56.06%)
Mutual labels:  simd, avx2, simd-programming, simd-instructions
std find simd
std::find simd version
Stars: ✭ 19 (-71.21%)
Mutual labels:  simd, avx2, simd-instructions
positional-popcount
Fast C functions for the computing the positional popcount (pospopcnt).
Stars: ✭ 47 (-28.79%)
Mutual labels:  simd, avx2, simd-instructions
ternary-logic
Support for ternary logic in SSE, XOP, AVX2 and x86 programs
Stars: ✭ 21 (-68.18%)
Mutual labels:  simd, avx2
Unisimd Assembler
SIMD macro assembler unified for ARM, MIPS, PPC and x86
Stars: ✭ 63 (-4.55%)
Mutual labels:  simd, avx2
Umesimd
UME::SIMD A library for explicit simd vectorization.
Stars: ✭ 66 (+0%)
Mutual labels:  simd, avx2
Quadray Engine
Realtime raytracer using SIMD on ARM, MIPS, PPC and x86
Stars: ✭ 13 (-80.3%)
Mutual labels:  simd, avx2
Base64simd
Base64 coding and decoding with SIMD instructions (SSE/AVX2/AVX512F/AVX512BW/AVX512VBMI/ARM Neon)
Stars: ✭ 115 (+74.24%)
Mutual labels:  simd, avx2
Md5 Simd
Accelerate aggregated MD5 hashing performance up to 8x for AVX512 and 4x for AVX2. Useful for server applications that need to compute many MD5 sums in parallel.
Stars: ✭ 71 (+7.58%)
Mutual labels:  simd, avx2
simd-byte-lookup
SIMDized check which bytes are in a set
Stars: ✭ 23 (-65.15%)
Mutual labels:  simd, avx2
Guided Missile Simulation
Guided Missile, Radar and Infrared EOS Simulation Framework written in Fortran.
Stars: ✭ 33 (-50%)
Mutual labels:  simd, avx2
Simde
Implementations of SIMD instruction sets for systems which don't natively support them.
Stars: ✭ 1,012 (+1433.33%)
Mutual labels:  simd, avx2
Vc
SIMD Vector Classes for C++
Stars: ✭ 985 (+1392.42%)
Mutual labels:  simd, avx2
lsp-dsp-lib
DSP library for signal processing
Stars: ✭ 37 (-43.94%)
Mutual labels:  simd, simd-instructions
Libsimdpp
Portable header-only C++ low level SIMD library
Stars: ✭ 914 (+1284.85%)
Mutual labels:  simd, avx2
Simd
C++ image processing and machine learning library with using of SIMD: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX-512, VMX(Altivec) and VSX(Power7), NEON for ARM.
Stars: ✭ 1,263 (+1813.64%)
Mutual labels:  simd, avx2
Nsimd
Agenium Scale vectorization library for CPUs and GPUs
Stars: ✭ 138 (+109.09%)
Mutual labels:  simd, avx2
Simdjson
Parsing gigabytes of JSON per second
Stars: ✭ 15,115 (+22801.52%)
Mutual labels:  simd, avx2
Boost.simd
Boost SIMD
Stars: ✭ 238 (+260.61%)
Mutual labels:  simd, avx2
Fastnoisesimd
C++ SIMD Noise Library
Stars: ✭ 542 (+721.21%)
Mutual labels:  simd, avx2

sliceslice

Actions Crate Docs License

A fast implementation of single-pattern substring search using SIMD acceleration, based on the work presented by Wojciech Muła. For a fast multi-pattern substring search algorithm, see instead the aho-corasick crate.

Example

use sliceslice::x86::DynamicAvx2Searcher;

fn main() {
    let searcher = unsafe { DynamicAvx2Searcher::new(b"ipsum".to_owned().into()) };

    assert!(unsafe {
        searcher.search_in(b"Lorem ipsum dolor sit amet, consectetur adipiscing elit")
    });

    assert!(!unsafe {
        searcher.search_in(b"foo bar baz qux quux quuz corge grault garply waldo fred")
    });
}

Benchmarks

We ran the i386 benchmarks on an HP EliteDesk 800 G2 Tower PC with an Intel Core i7-6700 Processor @ 3.40GHz, 16GB of RAM and 512GB of disk space, running Ubuntu 20.04.1 LTS, gcc 9.3.0 and Rust 1.46.0.

Library Version Function Short haystack Long haystack
std 1.46.0 String::find [335.32 ms 335.56 ms 335.83 ms] [344.62 ms 345.01 ms 345.52 ms]
memmem 0.1.1 TwoWaySearcher::search_in [87.927 ms 88.029 ms 88.151 ms] [401.40 ms 401.59 ms 401.81 ms]
twoway 0.2.1 find_bytes [274.60 ms 274.82 ms 275.07 ms] [146.32 ms 146.44 ms 146.58 ms]
sse4-strstr¹ 0.0.0-9308a59 avx2_strstr_v2 [75.389 ms 75.515 ms 75.682 ms] [38.521 ms 38.579 ms 38.649 ms]
sliceslice 0.2.0 DynamicAvx2Searcher::search_in [79.283 ms 79.416 ms 79.596 ms] [35.135 ms 35.181 ms 35.247 ms]

¹ sse4-strstr is not memory safe as it can read beyond the end of the haystack, please see the documentation for sliceslice where this is discussed in more detail.

Benchmarks results column chart

Licensing

Licensed under the MIT license. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].