Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'll still pick lz4 based on the benchmark.


Which algorithm is best is use-case dependent. As of now, zstd offers best-in-class compression for a wider variety of use cases than lz4. lz4 (created by the same author) still wins for high-throughput software compression, yes. But zstd --fast 4 or 5 are getting pretty close.


It's not obvious to me what the relevant measurements are on the zstd side, but I'm pretty sure lz4 wins considerably where code size and RAM footprint are major considerations, as in some bootloader and embedded firmware situations.


The provided benchmark table did illustrate when to choose which:

  Compressor name       Ratio  Compression  Decompress.
  zstd 1.3.4 -1         2.877    470 MB/s    1380 MB/s
  zlib 1.2.11 -1        2.743    110 MB/s     400 MB/s
  brotli 1.0.2 -0       2.701    410 MB/s     430 MB/s
  quicklz 1.5.0 -1      2.238    550 MB/s     710 MB/s
  lzo1x 2.09 -1         2.108    650 MB/s     830 MB/s
  lz4 1.8.1             2.101    750 MB/s    3700 MB/s
  snappy 1.1.4          2.091    530 MB/s    1800 MB/s
  lzf 3.6 -1            2.077    400 MB/s     860 MB/s


Zstd is better suited as a general purpose algorithm. It's like zlib only with better performance and a wider application range.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: