Originally posted by Anux
View Post
Limited to that specific scenario with fixed hardware, fixed OS settings, and fixed compressor settings, LZ4 is always faster at decompression and compression over LZO and Zstd. When it comes to compression ratios, LZO has a very slight edge over LZ4 while Zstd has the edge over LZO. In regards to decompression, LZ4 is always fastest followed by Zstd and then LZO. That will happen with any CPU or memory combination from the x86_64 era. The only time they'll have similar numbers and that generalization won't work is if there's a disk bottleneck...and even then there's the generalization that accessing compressed data from a slow drive is faster with a CODEC than accessing the same data uncompressed from the slow drive since the data is larger uncompressed. In that case, under a severe bottleneck, LZ4 is still the fastest and generally best one to use in regards to raw throughput and system responsiveness.
Speaking of Zstd, LZ4 and OpenZFS, LZ4 is so fast that OpenZFS first uses LZ4 first to determine if data can be compressed and then it'll hand that off to Zstd if it compresses. They do that because it turns out that using LZ4 as a testing heuristic is faster than the heuristic that Zstd uses to determine if data can be compressed or not. Go figure.
Comment