Skip to main content

Crate crous_simd

Crate crous_simd 

Source
Expand description

§crous-simd

Optional SIMD-accelerated routines for Crous encoding/decoding.

This crate provides optimized implementations of performance-critical operations. On aarch64 (Apple Silicon, etc.) it uses NEON intrinsics. On x86_64 it uses SSE2/AVX2 when available. All functions have scalar fallbacks for unsupported platforms.

§Feature flags

  • simd-varint — enable SIMD-accelerated varint boundary pre-scan. Idea: https://github.com/as-com/varint-simd

§Provided routines

  • batch_decode_varints — decode multiple LEB128 varints sequentially
  • batch_decode_varints_simd — SIMD pre-scan variant (feature simd-varint)
  • find_byte — locate first occurrence of a byte (SIMD-accelerated)
  • count_byte — count occurrences of a byte (SIMD-accelerated)
  • find_non_ascii — locate first non-ASCII byte (for fast UTF-8 pre-scan)

Functions§

batch_decode_total_consumed
Total bytes consumed by a batch decode.
batch_decode_varints
Batch-decode multiple varints from a contiguous buffer (scalar path).
batch_decode_varints_simd
Batch-decode varints using SIMD pre-scan to determine boundaries first.
count_byte
Count the number of occurrences of needle in data.
find_byte
Scan a byte slice for a specific byte using SIMD where available.
find_non_ascii
Find the first byte with the high bit set (non-ASCII).