Lurker News

Comments (21) 11 threads

Show all comments

Showing thread 5 of 11

nellacross1 reply#
I'd love to see a deeper comparison against LZ4. An LZ4-style decoder can be made minimal, and one can use LZ4HC to achieve better density without sacrificing decompression speed.
seb37731 reply#
You're right : a minimalist LZ4 decoder can be written in ~150-200 bytes of assembly or even ~35 lines of C because it doesn't have to handle a bitstream. However, LZ0's compact decoders are exactly the same size: lz0dec_x86_64.s: 184 bytes lz0dec_arm64.s: 180 bytes (pure leaf, 0 bytes of stack) lz0dec_riscv64.s: 160 bytes (pure leaf, 0 bytes of stack) lz0dec_min.c: 47 lines of C, 0 allocations, 0 libc

So LZ0 offers the same decoder compactness as a minimal LZ4 decoder, but for an Elias gamma bitstream with arbitrary window.

nellacross1 reply#
Interesting — Although I care more about speed and compression ratio, it seems like Zstd would still beat LZ0.

Still, it could be a good fit for use cases like embedded systems with very limited bandwidth and RAM.

seb3773#
just in case my previous reply isn't visible to everyone: I did respond to your message, but it seems HN's moderation system flagged my comment (and 2 other answers I did to other questions), not that I did not want to respond