pub unsafe fn delta_encode_avx2(values: &[u32]) -> Vec<u32>Expand description
AVX2-accelerated batch delta encoding.
Computes differences between consecutive u32 values using 256-bit SIMD registers, processing 8 values per iteration.
§Safety
This function is marked unsafe because it requires:
- AVX2 CPU feature support (verified by caller)
- Proper alignment for SIMD operations (uses unaligned loads)
The function is safe to call when AVX2 is available.
§Arguments
values- Slice of u32 values (must have length >= 2)
§Returns
Vector of delta-encoded values
§Performance
- Throughput: 8 u32 values per iteration
- Speedup: ~3-5x for arrays > 100 elements
- Overhead: Falls back to scalar for < 16 elements