← Sat, Nov 21 digest

Show HN: LZ0 -An asymmetric LZ compressor with ultra minimal, 0-alloc decoder

read article ↗ hn thread ↗

LZ0 is a new experimental asymmetric compression format featuring an encoder with advanced match-finding pipelines and an ultra-minimal, zero-allocation decoder.

read it Offers a thorough technical breakdown of an asymmetric compression format, complete with architecture details, benchmark tables, and memory/speed tradeoffs.

summary

LZ0 shifts compression complexity entirely to the encoder, enabling an extremely lightweight, zero-allocation decoder suitable for bootloaders, microcontrollers, and constrained environments. The encoder uses a multi-tier pipeline combining hash chains, linear-time suffix arrays (SA-IS), and sparse dynamic programming to achieve compression ratios competitive with ZX0 and UPKR. Meanwhile, its various decoders deliver high throughput without dynamic memory or complex state tables.

key points

  1. The decoder requires zero dynamic memory allocation, maintains minimal state, and fits into around 150 lines of C or compact assembly.
  2. The H2C8 encoder pipeline uses hash chains and an O(N) SA-IS suffix array coupled with a sparse dynamic programming parser to compress megabyte files in seconds.
  3. Benchmarks show LZ0 outperforming LZ4 in compression density while sustaining decompressor throughputs between 400 and 1,355+ MB/s.

who should read it

Systems programmers and embedded developers working with resource-constrained decoding environments.

discussion warm

consensus

Commenters appreciate the asymmetric design concept and discuss potential use cases like zram swap or comparisons against LZ4HC and ZX0.

pushback

One commenter points out that parts of the documentation appear AI-generated and mix English and French.

best comment by seb3773 ↗

I built LZ0, an asymmetric LZ compressor targeting environments where decompression resources are tightly constrained (bootloaders, microcontrollers, embedded asset loading) or where decoder simplicity matters most. I've always admired micro-decoders like Einar Saukas' ZX0—zero dynamic allocation, no scratch RAM, and small enough to fit into a handful of instructions. The catch with traditional optimal parsers is that they often scale in O(N^2), taking tens of seconds or minutes once files exceed a few hundred kilobytes. I wrote LZ0 to keep that same decoder footprint while compressing …

The author details the performance trade-offs, target use cases, and how the encoder avoids the O(N^2) scaling wall.

Generated by an LLM from the article and thread. Check the sources before relying on it.