ALL INTELLIGENCE
Hacker News AIT2·Tools

Show HN: misa77 Decompresses Up to 3x Faster Than zstd

Original title: Show HN: misa77 – Up to 3x faster decompression than zstd, with better ratios
58AI Score

misa77 0.9.0 is an LZ-based compressor built for write-once, read-many workloads, prioritizing very high single-threaded in-memory decompression throughput. At LZ4- and zstd-class ratios it decodes roughly 2x faster than its counterparts, and up to 3x in some cases, trading slower compression for constant-memory encoding and safe handling of corrupt or malicious input.

Related Entities

Full Report

Contents2 sections

misa77 (0.9.0)

misa77 is an LZ-based compressor that targets the write-once, read-many niche. In particular, it aims to satisfy the following criteria:

  1. Extremely high decompression throughput (single-threaded and in-memory).
  2. Good compression ratios relative to decode throughput. For reference, misa77 levels that correspond to LZ4 and zstd-class ratios decode roughly 2 times faster than their counterparts.
  3. Constant memory use during compression, regardless of input size.

Slow compression is the obvious tradeoff that we make to achieve the above.

Decompression is guaranteed to be safe in the case of corrupt/malicious input (i.e. the decompressor terminates gracefully, and does not access out-of-bounds memory or engage in any other UB) .

Benchmarks

A terse summary of misa77's performance would be that relative to its competitors (LZ4 class codecs for levels 1 to 6, and zstd/brotli/xz for levels 11 to 13), it encodes somewhat slower, gets similar ratios, but decodes much faster.

Some results on specific corpora follow. For more detailed and cross-platform results, see BENCHMARKS.md.

The benchmarks below were run on the following setup:

  • CPU: Intel(R) Core(TM) i7-14650HX (@2.2 GHz) (Intel Turbo disabled).
  • Single threaded, pinned to a single performance core.
  • CPU governor set to performance, uncore frequency pinned at its maximum.

The benchmarking harness used was lzbench. misa77 has also been merged into TurboBench, and the results below can be reproduced through both harnesses.

Silesia Corpus

This corpus can be found here. It contains 12 files, totaling 212 MB, covering text, source code, databases, executables, and medical images. It is the standard (albeit outdated) corpus for comparing general-purpose compressors.

<picture> <source media="(prefers-color-scheme: dark)" srcset="misc/lzbench-results-archive/0.9.0/decode_vs_ratio_dark.svg"> <img alt="Decode throughput vs compression ratio on silesia.tar (Intel)" src="misc/lzbench-results-archive/0.9.0/decode_vs_ratio_light.svg"> </picture>

The takeaway is that levels 3-6 dominate LZ4 (and other codecs in this class) on decode speed. Level 6 in particular gets smaller ratios and decodes ~2x faster (...and encodes much slower). Levels 11-13 get ratios similar to those of zstd's levels 11 to 22, while decoding about 2.5 to 3 times faster.

Note: lzbench lists misa77 as two codecs, as its levels are not contiguous. misa77 is levels 1 to 6 and misa77ec is levels 11 to 13.

<details> <summary>Table: silesia.tar (Intel)</summary>
Compressor nameCompressionDecompress.RatioFilename
misa77 0.9.0 -1233 MB/s4495 MB/s46.74silesia.tar
misa77 0.9.0 -2168 MB/s5157 MB/s44.28silesia.tar
misa77 0.9.0 -371.9 MB/s5909 MB/s42.59silesia.tar
misa77 0.9.0 -442.9 MB/s5227 MB/s40.33silesia.tar
misa77 0.9.0 -510.6 MB/s5160 MB/s37.76silesia.tar
misa77 0.9.0 -61.79 MB/s5334 MB/s32.34silesia.tar
misa77ec 0.9.0 -1133.1 MB/s2445 MB/s27.38silesia.tar
misa77ec 0.9.0 -125.81 MB/s2496 MB/s25.83silesia.tar
misa77ec 0.9.0 -131.39 MB/s2633 MB/s24.82silesia.tar
lz4 1.11.0383 MB/s2551 MB/s47.32silesia.tar
lz4hc 1.11.0 -921.2 MB/s2480 MB/s36.75silesia.tar
lz4hc 1.11.0 -127.80 MB/s2563 MB/s36.45silesia.tar
lzav 7.2 -1341 MB/s1697 MB/s39.23silesia.tar
lzav 7.2 -269.6 MB/s1719 MB/s34.54silesia.tar
zxc 1.0.0 -3122 MB/s3719 MB/s46.59silesia.tar
zxc 1.0.0 -554.5 MB/s3250 MB/s40.81silesia.tar
zxc 1.0.0 -75.11 MB/s1989 MB/s33.09silesia.tar
zstd 1.5.7 -1297 MB/s905 MB/s34.54silesia.tar
zstd 1.5.7 -598.6 MB/s853 MB/s29.60silesia.tar
zstd 1.5.7 -1126.7 MB/s976 MB/s27.35silesia.tar
zstd 1.5.7 -156.86 MB/s997 MB/s26.83silesia.tar
zstd 1.5.7 -192.32 MB/s870 MB/s24.93silesia.tar
zstd 1.5.7 -221.51 MB/s813 MB/s24.67silesia.tar
zlib 1.4 -97.41 MB/s199 MB/s31.91silesia.tar
libdeflate 1.26 -123.08 MB/s599 MB/s30.51silesia.tar
brotli 1.2.0 -540.5 MB/s284 MB/s28.11silesia.tar
brotli 1.2.0 -812.7 MB/s309 MB/s26.96silesia.tar
xz 5.8.4 -62.30 MB/s78.1 MB/s23.35silesia.tar
xz 5.8.4 -92.01 MB/s79.1 MB/s23.01silesia.tar
bzip3 1.5.4 -59.38 MB/s9.79 MB/s22.29silesia.tar
bzip2 1.0.8 -99.11 MB/s26.7 MB/s25.75silesia.tar
</details>

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)