Skip to main content

best_compressed_len

Function best_compressed_len 

Source
pub fn best_compressed_len(body: &[u8]) -> usize
Expand description

The smallest body compresses to across the built-in compressors (deflate / lz4 / zstd), or its raw length when none helps — the “fair fight” size for an arbitrary byte string. This is the same shop-every-compressor rule message_to_wire_best’s Smallest goal applies to the LOGOS wire, exposed so a benchmark can grant a COMPETITOR codec the identical compression opportunity: then a size comparison is compressed-vs-compressed (fair), not compressed-LOGOS-vs-raw-competitor.