Workshop · floor model for Survey of Software 1.050

compresso

One answer for the whole range, except the two far ends. Zstandard — in Python's standard library since 3.14 — covers everything between "as small as brotli can go" and "as fast as lz4 can go". This page measures that on your own file.

Drop your own file below. It never leaves this tab: the codecs run here, in your browser, and the numbers are about your data.

Plain language. Switch to Engineering for versions, byte counts and the measurements behind each claim.

The whole answer, first

Every setting of every codec on one line — slowest-and-smallest on the left, fastest-and-biggest on the right. One library covers the whole middle. You leave it only at the two ends.

Pareto view collapsed to one axis. Zstandard's levels 1–22 span the range and dominate every other library's settings on ratio, speed, or both — except brotli 11 (beyond zstandard's reach on ratio, more so on small web text) and lz4 0 (beyond it on speed). The chart below is the measured version of this picture, on your data.

Zstandard covers the whole middle; brotli owns the far size end, lz4 the far speed end smallest, slowest fastest, biggest brotli zstandard — every setting in here lz4 quality 11, web text: the last 3–16% level 1 (fast) … 3 (default) … 19 (archive) whichever level wrote it, it reads back at the same ~1 GB/s level 0 only: 3× faster reads gzip, zlib-ng, snappy, lz4 levels 1–16, brotli 0–10: all somewhere a zstandard level already beats

Use zstandard. Leave it for brotli only at quality 11 on web text you will serve many times, and for lz4 only at level 0 when read speed is the budget. Choose the level by who pays: a higher level costs the writer once and the reader nothing.

The rule of this page: every figure below is measured on your machine while you wait, by the Python libraries themselves running in this tab. Where a number came from research instead, it says so in orange.

Drop a file here, or . Read locally, capped at the first 1 MB, never uploaded.

Press start to download CPython 3.14 (WebAssembly). First time only, then cached.

The curve — measured on your data

Every codec, at every setting it offers, on the data you chose. Up means smaller; right means faster. The rings mark each library's default — and where the defaults sit is most of the story.

Compression ratio (in/out) against compression throughput (log scale), full level sweep per codec, measured in this tab under Pyodide. Rings mark defaults: zstandard 3, brotli 11, lz4 0, zlib 6. Table below has every point plus decompression throughput.

Waiting for start.

zstandard — the default, and now the standard library

Drag the level. Watch which bar moves and which one doesn't.

Level sweep 1–22 on the full sample; ratio, compression and decompression throughput. Round-trip verified each run. Below: compression.zstd from the 3.14 standard library, byte-compared against the zstandard package.

Waiting for start.

The surprise: the read-back speed barely changes whichever level you wrote at. You pay for compression once, at write time; every read afterwards costs the same. For anything written once and read many times, "as hard as you can afford" is the right level — the reader never notices.

Decompression throughput is level-invariant for zstandard, brotli and lz4 alike — the format is what the decoder walks, and a harder search at encode time produces the same kind of format. Only bz2 and xz make the reader pay. The other thing the slider shows: the ratio curve is flat and the speed curve is a cliff. On the novel, level 1 → 19 is about a third smaller for roughly a hundred times the compression time.

brotli — the ratio, at a price the default hides

The slider starts where brotli.compress() starts if you don't say otherwise: quality 11, the slowest setting it has. Drag it left and watch the speed bar.

Quality sweep 0–11. Default is 11 (zstandard's default is 3 — the two libraries pick their defaults from opposite ends of the curve). The comparison line finds the zstandard level that reaches the same ratio, from the sweep above, and reports its speed.

Waiting for start.

The reputation is a default. "Brotli is slow" is true of quality 11. On the novel, quality 5 or 6 reaches the same size as zstandard's level 6 at a comparable speed. What 11 buys over the best zstandard can do is a few percent on a big file — and rather more on a small one: brotli ships a built-in dictionary of web text, and the shorter the input the more that dictionary is worth. Drop a README or a web page on it and watch the comparison line.

The crown is real, and it grows as the file shrinks. Native, one machine: on the 738 KB novel brotli 11 gives 3.47× against zstandard 19's 3.37× — 3% smaller for 5× the time. On the first 32 KB of the same novel, 3.11× against 2.69× — 16% smaller. On a 40 KB markdown file brotli 5 (53 MB/s) matches zstandard 15 (11 MB/s). That is the static dictionary plus context modelling paying off where there is too little input to learn from; zstandard's answer at that size is a trained dictionary, which the survey covers. And bz2 from the standard library beat both on the whole novel at 3.96×, reading back at 42 MB/s. The ratio champion depends on the data; the speed of getting there depends on the setting.

lz4 — the speed, at exactly one setting

Level 0 is the point of LZ4 (1 and 2 are the same thing). Drag to 3 and beyond and it becomes a slower, weaker zstandard.

Level sweep 0–16 (lz4.frame; 3+ is the HC encoder). The comparison line finds the zstandard level from the sweep that is at least as small and at least as fast — when one exists, this LZ4 setting is dominated.

Waiting for start.

Where LZ4 wins is reading: several times faster than anything else on this page. Where it does not is anywhere you turned the level up.

The survey had this library down for a "10% reduction" — measured, its default gives 1.65× on the novel and 3.6× on the JSON logs. It also had it as unrunnable in Pyodide; that was true of the 0.27 line and is not true of the current release, which is why this panel is teal rather than orange.

zlib-ng and isal — the drop-in, measured

If your code already speaks gzip and cannot change formats, these two swap in underneath it. Not runnable in this tab; measured on one machine instead.

Neither ships in Pyodide. Live below: stdlib zlib at its default, for a baseline you can see. Orange: native figures for the same sample on the machine the survey was verified on.

Waiting for start.

From research, not measured in this tab

Native CPython 3.14.7, one machine (aarch64, single thread), same novel and JSON as above:

vs stdlib zliblevelcompressdecompressoutput
zlib-ng 1.0.06 (default)2.8× faster (text), 1.6× (JSON)1.8–1.9× fasterwithin 2% of zlib's size either way — compatible, not identical bytes
zlib-ng11.9× faster1.5×27–31% larger than zlib level 1 — a different, faster strategy
zlib-ng91.5–1.7× faster1.8–1.9×same size (text), 5% larger (JSON)
isal 1.8.00–3 (its whole range)1.7–4.7× faster than zlib 1–61.0–1.2× — little or no gain on this ARM machineits top level lands 14–24% larger than zlib's default

The survey said "identical output at 2–3× the speed". Half right: the format is identical and the default level lands in that range, but the bytes differ, level 1 trades a quarter of the ratio away, and isal's decompression advantage did not show up on this machine at all. Both do exactly one job — keeping call sites unchanged — and do it. The survey has the workings.

snappy — inherited, not chosen

From research, not measured in this tab

python-snappy is not in Pyodide either. Native, same machine: it compresses at LZ4's speed and LZ4's ratio (1.67× on the novel, 418 MB/s) and reads back three times slower than LZ4 (1.1 GB/s against 3.4). Nothing on the curve is uniquely its own.

It is chosen for you by Parquet, Kafka, Hadoop and Cassandra, which is a fine reason. One correction to the survey: since 0.7 it is a thin layer over cramjam and needs no system library — pip install python-snappy is the whole install now.

Small things — when compressing makes it bigger

Type a short message — an API response, a cache key, a token. Some of these codecs will hand you back more bytes than you gave them.

Container overhead on tiny payloads. Measured on a two-byte input: brotli adds 4 bytes, zstandard 9, gzip 20, lz4 23, bz2 35, xz 58. Below roughly a hundred bytes the wrapper is the story.

Waiting for start.

Start your build

Take what you just measured and hand it to whichever AI you use. This copies your sample, the settings you tried, the numbers they produced, and a brief for what to do next.

Clipboard envelope — no vendor deep link, no API key, no dependency on anyone's roadmap. Paste into any assistant.

Run the page first.

compresso is a floor model for Survey of Software 1.050 — Compression Libraries, verified 2026-08-18. Libraries run under Pyodide (CPython 3.14 compiled to WebAssembly) in this tab; nothing is sent anywhere. Throughput here is WebAssembly throughput — roughly half of native on the machine this was checked against, with the same shape. Measurements are from your machine except where marked orange. The novel is Jane Austen's Pride and Prejudice, public domain.

Made by Ivan Schneider · Model Citizen Developer