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.
Asked
Active
Viewed 5,382 times
1
-
3No, we cannot. If there is a universally best compression algorithm in existence, it has yet to be discovered. The best known ones will tend to each favor (slightly) a particular type of input pattern. This question is off-topic here anyway - it is not a programming question. Having said that, couldn't you just try the various candidate algorithms that you are considering and pick the best one yourself? – 500 - Internal Server Error Dec 26 '16 at 14:38
2 Answers
5
Your google-fu is very weak. A quick search turns up many benchmarks. One of which is right there on the lz4 page. 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.

Mark Adler
- 101,978
- 13
- 118
- 158
0
Taken from this presentation: https://indico.cern.ch/event/631498/contributions/2553033/attachments/1443750/2223643/zlibvslz4presentation.pdf
also checkout Difference: LZ77 vs. LZ4 vs. LZ4HC (compression algorithms)?

n0099
- 520
- 1
- 4
- 12