logoalt Hacker News

dist-epochyesterday at 3:17 PM5 repliesview on HN

You need to crank up zstd compression level.

zstd is Pareto better than brotli - compresses better and faster


Replies

atiedebeeyesterday at 3:49 PM

I thought the same, so I ran brotli and zstd on some PDFs I had laying around.

  brotli 1.0.7 args: -q 11 -w 24
  zstd v1.5.0  args: --ultra -22 --long=31 
                 | Original | zstd    | brotli
  RandomBook.pdf | 15M      | 4.6M    | 4.5M
  Invoice.pdf    | 19.3K    | 16.3K   | 16.1K
I made a table because I wanted to test more files, but almost all PDFs I downloaded/had stored locally were already compressed and I couldn't quickly find a way to decompress them.

Brotli seemed to have a very slight edge over zstd, even on the larger pdf, which I did not expect.

show 4 replies
DetroitThrowyesterday at 4:12 PM

I love zstd but this isn't necessarily true.

jeffbeeyesterday at 3:34 PM

Are you sure? Admittedly I only have 1 PDF in my homedir, but no combination of flags to zstd gets it to match the size of brotli's output on that particular file. Even zstd --long --ultra -22.

dchestyesterday at 4:07 PM

Not with small files.

show 1 reply
itsdesmondyesterday at 6:11 PM

> Pareto

I don’t think you’re using that correctly.

show 1 reply