Hacker News new | ask | show | jobs
by benatkin 87 days ago
Not really, it's a popular dictionary-based compression format.
2 comments

I'm pretty new to choosing compression libraries - I started with zlib and was delighted at how much faster and smaller zstd made things.

Since we kind of need a default "Need to compress something? Use this!" setting - would you prefer zlib over zstd, or something else for that role?

The only reason to pick anything but zstd is that platform support might be better.

If your platform/sdk/browser/standard-library comes with zlib/gzip/.. then it's often easier to just pick that.

No new dependencies is always a win. App size. Security, etc.

Otherwise, if zstd is easy to add, IMO I would always prefer, zstd, lz4 or brotli.

zstd or lz4
”Not really" what?

It's hard to understand what point you're trying to make. Can you clarify?

It isn't really the go-to compression format, because it isn't ubiquitous like gzip and zip, there are a variety of compression tools out there for different purposes, and there is image/audio/video compression. There is also specialized compression like what git does with its rolling hashes. I think of it as there not being a go-to compression format.
I think you're being a bit pedantic.

A go-to thing means it's a sensible default choice and has no little to no downsides (versus not using compression), it doesn't mean it's the best for everything.

Until now the go-to has been DEFLATE (gzip and zip) but zstd is definitely competing against it because it is better in almost every way.