RepositoryCUSUnited States
meta

meta/zstd

Zstandard - Fast real-time compression algorithm

28.4kstars
2.7kforks
223issues
1views

⚡ Zstandard: Fast, tunable lossless compression

Real-time compression speed with ratio control and strong gains on small, correlated data.

Zstandard (zstd) is a fast lossless compression algorithm targeting real-time compression scenarios at zlib-level and better compression ratios. Backed by a very fast entropy stage provided by Huff0 and FSE, it's shipped as the reference implementation: an open-source dual BSD OR GPLv2 licensed C library and a command line utility that produces and decodes .zst, .gz, .xz and .lz4 files. Its format is stable and documented in RFC8878, with multiple independent implementations already available.

✨ Highlights

  • Speed-first design: Built for real-time compression with very high compression and decompression speeds, often outperforming common fast compressors on in-memory benchmarks.
  • Configurable trade-off: Use negative levels like --fast=# for faster compression/decompression at lower ratio, or higher positive levels for stronger ratios at the cost of compression speed.
  • Decompression stability: Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms.
  • Wide format support: The CLI can produce and decode .zst, .gz, .xz and .lz4 files.
  • Dictionary training for small data: With a few samples from a correlated data family, zstd can build a dictionary to dramatically improve compression ratio and simultaneously provide faster compression and decompression for small payloads.
  • Stable, portable reference: Dual-licensed C library with known ports and bindings listed on the Zstandard homepage.

💡 Why it matters

On typical file and stream scenarios, zstd aims to hit at least zlib-level ratios while keeping real-time speeds. For small data where compressors have little history to learn from, dictionary training tackles that exact weakness with large gains without sacrificing speed. The result is a single algorithm that can cover both high-throughput streaming and tricky small-data compression cases with one tunable tool.


#Compression #Lossless #C #TiniX