HN
Today

Show HN: misa77 – Up to 3x faster decompression than zstd, with better ratios

A new compression library, misa77, arrives on the scene, promising up to 3x faster decompression than zstd and LZ4 while maintaining competitive or better compression ratios. It's tailored for 'write-once, read-many' workloads, sacrificing compression speed for unparalleled decode throughput. This technical deep dive into performance metrics and implementation details is catnip for developers constantly seeking efficiency gains.

4
Score
0
Comments
#3
Highest Rank
10h
on Front Page
First Seen
Dec 3, 9:00 AM
Last Seen
Dec 3, 6:00 PM
Rank Over Time
25543710881217

The Lowdown

Misa77 is an ambitious new LZ-based compression library, currently in version 0.9.0, that targets applications where data is written once but read many times. Its core design philosophy ruthlessly prioritizes decompression throughput, aiming to deliver significantly faster decode speeds than established codecs like LZ4 and zstd, often with improved compression ratios.

  • Core Principles: Misa77 is engineered for extremely high single-threaded, in-memory decompression throughput, coupled with good compression ratios relative to that decode speed. It also ensures constant memory usage during compression, regardless of input size.
  • The Trade-off: The primary compromise made to achieve these goals is a slower compression speed.
  • Safety: The decompressor guarantees graceful termination and memory safety even with corrupt or malicious input.
  • Performance Benchmarks: Extensive benchmarks on corpora like Silesia and a custom Game Asset Corpus demonstrate misa77's prowess. It consistently decodes 2 to 3 times faster than its counterparts (e.g., LZ4-class codecs at levels 3-6, and zstd-class codecs at levels 11-13) while achieving similar or better compression ratios.
  • Levels and Formats: Misa77 is internally structured into two classes: levels 1-6 for simpler LZ compression (competing with LZ4) and levels 11-13 incorporating entropy coding and other advanced techniques (competing with zstd/brotli). Specific levels like 3 (fastest decode), 11, 12, or 13 (best ratio) are recommended based on requirements.
  • Technical Requirements: The library requires a C++20 compiler, CMake >= 3.20, and a little-endian 64-bit system. It leverages hand-written assembly kernels for optimal performance on x86-64 (AVX2/SSE2) and ARM64 (NEON).
  • Usage: It provides a C++ API for library integration and a CLI for file-based compression, decompression, and benchmarking.
  • Status & Acknowledgements: Currently v0.x.y, its format may change. It has undergone local fuzzing and draws inspiration from various well-known compression projects. Notably, the developer acknowledges significant assistance from multiple Claude AI models throughout its development.

In essence, misa77 presents a compelling option for developers seeking to drastically reduce decompression overhead in read-heavy applications, offering a fresh, highly optimized approach to a fundamental computing challenge.