HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
meta
zstd
C2016–2026
meta / zstd

zstd

Zstandard - Fast real-time compression algorithm

112Distinct people
165Mentions
2Explicit recommenders
28.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Zstandard - Fast real-time compression algorithm

GitHub

Where it is used

  • Chromium — Chromium ships this library to decode "Content-Encoding: zstd" responses. Source

What people are saying

First off, I love zstd and thanks for your work - I've used it multiple times with great success. My question is...what's up with zstd compression levels? It seems to be…

aidanhs used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 12:03:30 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year165 dated mentions

Observed mentions: 2016-08-31 17:28:01 UTC to 2026-09-07 15:41:05 UTC.

01020302016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 20 mentions; 4 submissions, 16 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 27 mentions; 5 submissions, 22 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 7 mentions; 3 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 14 mentions; 3 submissions, 11 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 12 mentions; 3 submissions, 9 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 27 mentions; 2 submissions, 25 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 7 mentions; 2 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 19 mentions; 1 submissions, 18 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 17 mentions; 3 submissions, 14 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC826
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC20416
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC27522
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC734
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC14311
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC1239
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC27225
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC725
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC19118
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC17314
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC707

What Hacker News says

19 sources
The latest Zstandard exposes several parameters which are useful for reducing time to first byte latency in web compression. They make Zstandard cut the compressed data into smaller blocks, e.g. 4 KB, with the goal to fit a compressed block within a small number of packets, so the browswer can start to decompress without waiting for a full 128 KB block to be sent. These parameters are described in the v1.5.6 release notes [0]. ZSTD_c_targetCBlockSize is the most notable, but ZSTD_c_maxBlockSize can also be used for a lower CPU cost but larger compressed size. Are you using these features at Cloudflare? If you need any help using these, or have any questions, please open an issue on Zstandard's GitHub! [0] https://github.com/facebook/zstd/releases/tag/v1.5.6
In New standards for a faster and more private Internet
So to clarify: my suggested point of comparison was replacing QOI + 7Zip of GP with QOIR + zstd. QOIR already compresses better than QOI before the LZ4 pass, and zstd compresses faster than 7zip and often better. On top of that you can put zstd in the header option when streaming data on a browser so you don't need to increase the JS bundle or whatever if the use case is the web. So that's basically a guaranteed net improvement all around. Second of all, the speed/compression trade-off with zstd can be tuned a lot. The "half as fast as LZ4" stat is for the fastest setting, but for the proposed comparison point of 7zip a slower setting with better compression ratio is likely perfectly fine. [0] https://github.com/facebook/zstd/tree/dev?tab=readme-ov-file...
In Porting my JavaScript game engine to C for no reason
> For such small string, any statistical compression won't have a smaller size That is a statement you can make, but you have to actually demonstrate this is true against zstd's --train mechanism [1] which generates a more optimized "small string" dictionary based on representative training data precisely for this use-case. [1] https://github.com/facebook/zstd/blob/dev/programs/zstd.1.md > those are used for different scenarios. zstd is used for data compression, the meta string encoding here is used for meta meta encoding Not sure what this means. The motivating use-case described for the alternate string encoding is precisely compression.
In Meta String: A more space-efficient string encoding than UTF-8 in Fury
> In such cases, the serialized binary are mostly in 200~1000 bytes. Not big enough for zstd to work You're not referring to the same dictionary that I am. Look at --train in [1]. If you have a training corpus of representative data, you can generate a dictionary that you preshare on both sides which will perform much better for very small binaries (including 200-1k bytes). It's the same kind of technique but zstd's mechanism is absolutely general whereas purpose-built non-entropy based dictionaries are more limited & less likely to outperform. If you want maximum flexibility (i.e. you don't know the universe of representative messages ahead of time or you want maximum compression performance), you can gather this corpus transparently as messages are generated & then generate a dictionary & attach it as sideband metadata to a message. You
Read the rest
'll probably need to defer the decoding if it references a dictionary not yet received (i.e. send delivers messages out-of-order from generation). There are other techniques you can apply, but the general rule is that your custom encoding scheme is unlikely to outperform zstd + a representative training corpus. If it does, you'd need to actually show this rather than try to argue from first principles. [1] https://github.com/facebook/zstd/blob/dev/programs/zstd.1.md
In Meta String: A more space-efficient string encoding than UTF-8 in Fury
You can already pre-train compression on text without using an LLM: $ curl https://www.gutenberg.org/cache/epub/11/pg11.txt > text.txt $ split -n 500 text.txt trainpart. Using a normal compression algorithm: $ zstd --train trainpart.* -o dictionary Save dictionary of size 112640 into file dictionary $ zstd -vD dictionary text.txt *** Zstandard CLI (64-bit) v1.5.5, by Yann Collet *** text.txt : 15.41% ( 170 KiB => 26.2 KiB, text.txt.zst) For this example, ZSTD warns that the dictionary training set is 10X-100X too small to be efficient. Realistically, I guess you'd train it over E.G. the entire Gutenberg library. Then you can distribute specific books to people who already have the dictionary. Or: $ curl -L https://archive.org/download/completeworksofl1920carr/completeworksofl1920carr_h
Read the rest
ocr_searchtext.txt.gz | gzip -d | sed -E 's/\s+/ /g' > FullTextsSample.txt $ zstd -v -19 --patch-from FullTextsSample.txt text.txt text.txt : 16.50% ( 170 KiB => 28.1 KiB, text.txt.zst) Not sure how much performance would drop for realistic use. But there are also some knobs you can tune. Refer to: https://github.com/facebook/zstd/#dictionary-compression-how... https://github.com/facebook/zstd/wiki/Zstandard-as-a-patchin... $ man zstd - Dictionary occupies only kilobytes or megabytes of storage, instead of gigabytes or terabytes. - Dictionary can be re-trained for specific data at negligble cost. - Compression and decompression are deterministic by default. - Doesn't take large amount of GPU resources to compress/decompression. - This is actually designed to do this.
In Using a LLM to compress text
My point is, it's already possible to use multiple independently compressed (and decompressable) frames with zstd if you really want to. It's even in the zstd repo, under a "contrib" implementation https://github.com/facebook/zstd/blob/87af5fb2df7c68cc70c090... That does, of course, require that you compress it into multiple frames to begin with, which could be a problem if you don't control the source of the compressed files, because the default is a single frame. In theory if everyone used pzstd to compress their files, it would be strictly superior to BZ2 in nearly every circumstance. As it is, you do have to go out of your way to do that. But I don't think that necessarily means the single-frame choice by default is a bad tradeoff. It's better in most circumstances. And if they do eventually figure out a reasonably efficient way to
Read the rest
handle intra-frame parallel decompression, then it's just gravy.
In Bzip2 Format Specification (2016) [pdf]
For a benchmark on a standard set: https://github.com/inikep/lzbench/blob/master/lzbench18_sort... Of course, you may get different results with another dataset. gzip (zlib -6) [ratio=32%] [compr=35Mo/s] [dec=407Mo/s] zstd (zstd -2) [ratio=32%] [compr=356Mo/s] [dec=1067Mo/s] NB1: The default for zstd is -3, but the table only had -2. The difference is probably small. The range is 1-22 for zstd and 1-9 for gzip. NB2: The default program for gzip (at least with Debian) is the executable from zlib. With my workflows, libdeflate-gzip iscompatible and noticably faster. NB3: This benchmark is 2 years old. The latest releases of zstd are much better, see https://github.com/facebook/zstd/releases For a high compression, according to this benchmark xz can do slightly better, if you're willing to pay a 10× penalty on decompression. xz -9 [ratio=23%
Read the rest
] [compr=2.6Mo/s] [dec=88Mo/s] zstd -18 [ratio=25%] [compr=3.6Mo/s] [dec=912Mo/s]
In Chrome Feature: ZSTD Content-Encoding

Showing the 15 most recent of 19 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.