报道正文
本文目录2 个章节
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:
- Extremely high decompression throughput (single-threaded and in-memory).
- 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.
- 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.
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.9.0 -1 | 233 MB/s | 4495 MB/s | 46.74 | silesia.tar |
| misa77 0.9.0 -2 | 168 MB/s | 5157 MB/s | 44.28 | silesia.tar |
| misa77 0.9.0 -3 | 71.9 MB/s | 5909 MB/s | 42.59 | silesia.tar |
| misa77 0.9.0 -4 | 42.9 MB/s | 5227 MB/s | 40.33 | silesia.tar |
| misa77 0.9.0 -5 | 10.6 MB/s | 5160 MB/s | 37.76 | silesia.tar |
| misa77 0.9.0 -6 | 1.79 MB/s | 5334 MB/s | 32.34 | silesia.tar |
| misa77ec 0.9.0 -11 | 33.1 MB/s | 2445 MB/s | 27.38 | silesia.tar |
| misa77ec 0.9.0 -12 | 5.81 MB/s | 2496 MB/s | 25.83 | silesia.tar |
| misa77ec 0.9.0 -13 | 1.39 MB/s | 2633 MB/s | 24.82 | silesia.tar |
| lz4 1.11.0 | 383 MB/s | 2551 MB/s | 47.32 | silesia.tar |
| lz4hc 1.11.0 -9 | 21.2 MB/s | 2480 MB/s | 36.75 | silesia.tar |
| lz4hc 1.11.0 -12 | 7.80 MB/s | 2563 MB/s | 36.45 | silesia.tar |
| lzav 7.2 -1 | 341 MB/s | 1697 MB/s | 39.23 | silesia.tar |
| lzav 7.2 -2 | 69.6 MB/s | 1719 MB/s | 34.54 | silesia.tar |
| zxc 1.0.0 -3 | 122 MB/s | 3719 MB/s | 46.59 | silesia.tar |
| zxc 1.0.0 -5 | 54.5 MB/s | 3250 MB/s | 40.81 | silesia.tar |
| zxc 1.0.0 -7 | 5.11 MB/s | 1989 MB/s | 33.09 | silesia.tar |
| zstd 1.5.7 -1 | 297 MB/s | 905 MB/s | 34.54 | silesia.tar |
| zstd 1.5.7 -5 | 98.6 MB/s | 853 MB/s | 29.60 | silesia.tar |
| zstd 1.5.7 -11 | 26.7 MB/s | 976 MB/s | 27.35 | silesia.tar |
| zstd 1.5.7 -15 | 6.86 MB/s | 997 MB/s | 26.83 | silesia.tar |
| zstd 1.5.7 -19 | 2.32 MB/s | 870 MB/s | 24.93 | silesia.tar |
| zstd 1.5.7 -22 | 1.51 MB/s | 813 MB/s | 24.67 | silesia.tar |
| zlib 1.4 -9 | 7.41 MB/s | 199 MB/s | 31.91 | silesia.tar |
| libdeflate 1.26 -12 | 3.08 MB/s | 599 MB/s | 30.51 | silesia.tar |
| brotli 1.2.0 -5 | 40.5 MB/s | 284 MB/s | 28.11 | silesia.tar |
| brotli 1.2.0 -8 | 12.7 MB/s | 309 MB/s | 26.96 | silesia.tar |
| xz 5.8.4 -6 | 2.30 MB/s | 78.1 MB/s | 23.35 | silesia.tar |
| xz 5.8.4 -9 | 2.01 MB/s | 79.1 MB/s | 23.01 | silesia.tar |
| bzip3 1.5.4 -5 | 9.38 MB/s | 9.79 MB/s | 22.29 | silesia.tar |
| bzip2 1.0.8 -9 | 9.11 MB/s | 26.7 MB/s | 25.75 | silesia.tar |
(注:更多技术实现细节与完整 API 文档请查阅原项目 README)