Module compression
Record known compressors
Includes utilities for determining whether or not to compress
source linkFunctions
▶ def byte_sample(b, size, n) Sample a bytestring from many locations
▶ def decompress(header, frames) Decompress frames according to information in the header
▶ def maybe_compress(payload, min_size=1e4, sample_size=1e4, nsamples=5, ...) Maybe compress payload
def maybe_compress(
payload,
min_size=1e4,
sample_size=1e4,
nsamples=5,
compression=dask.config.get("distributed.comm.compression"),
)
1. We don't compress small messages
2. We sample the payload in a few spots, compress that, and if it doesn't
do any good we return the original
3. We then compress the full original, it it doesn't compress well then we
return the original
4. We return the compressed result
Reexports