Which one compress better in terms of size lz4 or zlib

6.3k views Asked by At

I need to use a compression technique. But can't decide between lz4 and zlib. I searched internet a little bit and lz4 is much recommended but i didn't find any data about the output size. So can anyone tell me which one is better in terms of final output size.

2

There are 2 answers

0
Mark Adler On

The lz4 Github repository has a benchmark that might be helpful. In general zlib will compress better, and take more time doing it, but your mileage may vary. Just try both on your data. Also look at zstd.