logoalt Hacker News

nine_klast Saturday at 5:47 PM3 repliesview on HN

Gzip is woefully old. Its only redeeming value is that it's already built into some old tools. Otherwise, use zstd, which is better and faster, both at compression and decompression. There's no reason to use gzip in anything new, except for backwards compatibility with something old.


Replies

kergonathlast Saturday at 5:51 PM

> Otherwise, use zstd, which is better and faster

Yes, I do. Zstd is my preferred solution nowadays. But gzip is not going anywhere as a fallback because there is a surprisingly high number of computers without a working libzstd.

duskwufflast Saturday at 8:39 PM

One other redeeming quality that gzip/deflate does have is that its low memory requirements (~32 KB per stream). If you're running on an embedded device, or if you're serving a ton of compressed streams at the same time, this can be a meaningful benefit.

adrian_byesterday at 12:25 PM

The claim that zstd is "better and faster", without additional qualifications, is false and misleading.

Indeed for many simple test cases zstd is both better and faster.

Despite that, it is possible to find input files for which zstd is either worse or slower than gzip, for any zstd options.

I have tested zstd a lot, but eventually I have chosen to use lrzip+gzip for certain very large files (tens of GB file size) with which I am working, because zstd was always either worse or slower. (For those files, at the same compression ratio and on a 6-year old PC, lrzip+gzip has a compression speed always greater than 100 MB/s, while zstd only of 30 to 40 MB/s.)

There are also other applications, where I do use zstd, but no compressing program is better than all the others in ALL applications.