Ashwa 馃悗
Hardware accelerated routines for single substring search
Language Support
ashwa is available across multiple language ecosystems,
Supported Platforms
| Architecture | Target Platform | Hardware Acceleration | Fallback |
|---|---|---|---|
| x86_64 | Linux, macOS, Windows, Android, FreeBSD | AVX-512BW, AVX2, SSE4.2, SSSE3, SSE2 | 64-bit SWAR |
| x86 (i686) | Windows, Linux | SSE2 | 32-bit SWAR |
| AArch64 (ARM64) | Apple Silicon, Linux ARM64, Android, FreeBSD | 128-bit ARM NEON | 64-bit SWAR |
| ARMv7 | Linux ARM, Android | 128-bit ARM NEON | 32-bit SWAR |
| WebAssembly | Browsers, Node.js (wasm32) | WASM SIMD128 (simd128) | 32-bit SWAR |
Usage
Add ashwa to your Cargo.toml:
[]
= "0.2.0"
Example
use search_one;
Benchmarks
search_one
For x86_64 machine targeting AVX-512BW SIMD ISA,
| Level | Payload | Latency | Throughput | ILP |
|---|---|---|---|---|
| L1 Cache | 32 KiB | 211.52 ns | 144.28 GiB/s | 1.74 insn/cyc |
| L2 Cache | 512 KiB | 3.32 碌s | 147.03 GiB/s | 2.53 insn/cyc |
| L3 Cache | 16 MiB | 495.57 碌s | 31.53 GiB/s | 0.54 insn/cyc |
| RAM | 256 MiB | 20.52 ms | 12.18 GiB/s | 0.21 insn/cyc |
Benchmarked using Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz (8C/16T) 路 L1d: 384 KiB, L1i: 256 KiB, L2: 10 MiB, L3: 54 MiB 路 STREAM Triad: 20.32 GB/s 路 +nightly toolchain
For aarch64 machine targeting NEON SIMD ISA,
| Level | Payload | Latency | Throughput | ILP |
|---|---|---|---|---|
| L1 Cache | 32 KiB | 667.79 ns | 45.70 GiB/s | 0.51 insn/cyc |
| L2 Cache | 512 KiB | 10.82 碌s | 45.14 GiB/s | 3.23 insn/cyc |
| L3 Cache | 16 MiB | 401.18 碌s | 38.95 GiB/s | 2.99 insn/cyc |
| RAM | 256 MiB | 9.89 ms | 25.28 GiB/s | 2.02 insn/cyc |
Benchmarked using ARM Neoverse-V1 (16C/16T) 路 L1d: 1 MiB, L1i: 1 MiB, L2: 16 MiB, L3: 32 MiB 路 STREAM Triad: 76.50 GB/s