Compression
- mosaic.comms.compression.maybe_compress(payload, min_size=10000.0, sample_size=10000.0, nsamples=5)[source]
Maybe compress payload:
We don’t compress small messages
We sample the payload in a few spots, compress that, and if it doesn’t do any good we return the original
We then compress the full original, it it doesn’t compress well then we return the original
We return the compressed result