Show HN: LZ0 -An asymmetric LZ compressor with ultra minimal, 0-alloc decoder gi...
Show HN @show
Show HN: LZ0 -An asymmetric LZ compressor with ultra minimal, 0-alloc decoder github.com · 2 points · 0 comments · HN thread
TL;DR LZ0 is an experimental lossless LZ compression format and C implementation by seb3773, presented as a Show HN. It moves complexity to the encoder so the decoder can be tiny, allocation-free, and fast, with several hand-written assembly decoders for x86-64 and AArch64. The README claims ratios comparable to ZX0 with encode times of seconds rather than minutes.
- The decoder uses no dynamic memory, only a few registers and an optional bitreader, and writes directly into a caller-provided buffer.
- The encoder combines a 3-byte hash chain, an O(N) SA-IS suffix array and a sparse dynamic programming parser (K=2 by default, up to K=32 in Ultra mode).
- The README reports encoding of about 1.5 to 2.7 s per MiB at default level -6 and decompression of 400 to 1,340 MB/s for the FAST x86-64 assembly decoder on the benchmarked files.
- On text and binaries the ratios are reported as close to UPKR and well below LZ4, while on JPEG and MP3 the format shows almost no inflation; on some high-entropy and PNG files it inflates slightly.
- Several decoders are provided: a portable C library decoder, a normative reference decoder, a roughly 40-line minimal C function, and x86-64 and ARM64 assembly versions.
- The format is independent of ZX0's bitstream and uses MSB-first control bits, Elias gamma integers and a raw low offset byte.
Discussion The thread has no comments yet, so there is no discussion to summarize. The submission has only 2 points.
#compression #lz77 #decompression #assembly #showHN #embedded