Skip to main content

Module cpu_gzip

Module cpu_gzip 

Source
Expand description

RFC 1952 gzip codec via flate2 (v0.4 #26).

Why CPU and not GPU: nvCOMP’s GDeflate produces a multi-stream parallel-decode-friendly format that is not a single valid DEFLATE stream — wrapping it with a gzip header doesn’t make stock gunzip decode it. To deliver the actual user-facing value of issue #26 (= “an S3 object S4 stored that any browser / curl / standard library can decompress without knowing about S4”), the codec has to emit a real gzip stream. CPU flate2 is the right tool.

Trade-off: no GPU acceleration on this codec. For wire-compat against gunzip-aware clients use cpu-gzip; for raw GPU throughput where everyone speaks S4 use nvcomp-zstd / nvcomp-bitcomp.

Default compression level is 6 — flate2’s default and the same level gzip(1) uses out of the box. Range 0..=9 (= flate2::Compression range).

Structs§

CpuGzip
CPU gzip codec (RFC 1952). level clamped to 0..=9.

Functions§

compress_blocking
Sync compress sibling of decompress_blocking. Provided for symmetry.
decompress_blocking
Sync, runtime-free decompress used by s4-codec-wasm (browser / WASM has no tokio runtime). Same checks as the trait implementation: codec/size match, decompression-bomb cap at manifest.original_size + 1024, crc32c verify after.