Expand description
Production Adaptive Compression
Real compression using LZ4 (lz4_flex) and Zstd:
- Performance tier: LZ4 frame compression (~4 GB/s decompress, ~2 GB/s compress)
- Standard tier: Zstd level 1 (~500 MB/s compress, ratio ~2.5x)
- Constrained tier: off (CPU > bandwidth)
Auto-probe: если compression ratio < threshold на первых N пакетах → отключить. Минимальный размер для сжатия = 64 байт (overhead не оправдан).
Structs§
- Adaptive
Compressor - Adaptive compressor with auto-probe.
- Compression
Stats - Compression statistics for auto-probe
Enums§
- Compression
Algo - Compression algorithm
- Compression
Error - Compression errors
Constants§
- MAX_
DECOMPRESSED_ LEN - Default upper bound on decompressed output (16 MiB — matches the
established-session frame cap in
TcpSessionTransport). Decompression is an asymmetric operation: a few KiB of crafted LZ4/Zstd can expand to gigabytes (a “decompression bomb”).AdaptiveCompressor::decompressenforces this cap unconditionally; callers that need a different bound useAdaptiveCompressor::decompress_with_limit.