Compression

From David's Wiki
\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)

Notes on compression

Lossless

Deflate

This is the compression used by gzip and implemented in the zlib library. Probably the most widely used compression algorithm, it is also commonly used for zip archives.

LZO

This focuses on decompression speed.

LZ4

Focuses on decompression speed, new and faster than LZO but with worse compression.

Brotli

A compression algorithm developed by Google, primarilly to replace gzip in HTTP. It is supported in all major browsers today.

Lzma

Lzma is used by 7z. It has very high compression levels but is generally very slow to compress.

Zstandard

Zstandard (zstd or .zst) is a recent compression algorithm by Facebook. It boasts very fast compression and decompression performance as well as very good compression levels, though not quite as good as lzma/7z.