Minimalist Guide to Lossless Compression (2019)
tech.marksblogg.com
tech.marksblogg.com
I'd not really thought of that aspect before... My old brain is hard-coded to save cpu cycles ... Time to change my ways :)
In fact, if you install Fedora 35 on btrfs, zstd:1 is enabled by default, using fs-level heuristics to decide when and when not to compress, reducing write amplification on SSD drives and gaining some space for free with negligible performance impact, which is nice.
My 8GB ~/src directory on encrypted btrfs on NVMe uses 6GB on disk and I can easily saturate the link while reading from it. Computers are plenty fast.
So unless you can multithread that workload, it's already behind by a factor of 2.
> Computers are plenty fast.
My point was you can no longer assume the disk is significantly slower, at least for streaming workloads. You can often still win by spending CPU cycles doing clever stuff, but it's not several orders of magnitude difference like it used to be.
http://fastcompression.blogspot.com/2015/01/zstd-stronger-co...
Taken from the fastcompression blog - where one could follow ZSTD's author since before ZSTD was even conceived.
"Conveniently" enough the author of the blog has written both ZSTD and LZ4, which top the chart for their respective link speed domains. (2015 data - things have improved in both ZSTD and others since then.)
In that case, there typically isn’t additional explicit compression (1). The main gain is in decreasing the number of http requests.
(1) the image itself may have inherent compression, and that may be improved by combining images with similar content, and the web server may be configured to use compression, but the first typically isn’t a big win, and the second is independent from this strategy.
1. modelling (you convert data to symbols and predict probabilities of seeing each symbol)
2. entropy coding (convert symbols + probabilities to minimum number of bits)
The second stage is relatively simple, and basically solved. We went from Huffman's approximation to Arithmetic Coding which is theoretically ideal, and now got ANS which is close to ideal and pretty fast too.
The modelling part is indeed a completely open problem, and at this point as much art as science.
Besides, humans are lossy. We forget, make mistakes, think via heuristic.
It seems important for compressibility to prepare the data for maximum self-similarity, in addition to the LZ algorithms (as evidenced by the sort in this article). Could someone point towards a good modern summary of the approaches or heuristics?
Shannon didn't coin the term entropy. He borrowed it from the analogous definition in thermodynamics.