>"LZ0 is an experimental lossless compression format and C implementation designed around a single guiding principle:
Move complexity from the decoder to the encoder." Great idea! Also, LZ0 might be great for compressing a computer's unused (aka "swap") virtual memory pages, i.e., like ZRAM, because if we think about the usage paradigm for that, the compress phase doesn't need to be time-bound, that is, page compression (if properly implemented) could use simply unused CPU cycles... i.e., not time bound if it doesn't need to be compressed and stored immediately... Decompression on the other hand (i.e., the page is needed by the computer) is a completely different story! Every nanosecond that a computer has to wait for a requested page costs the program which needs it, TIME! That is, the program (or thread(s) requiring that memory) are typically halted until it becomes available! So decompression of requested previously unused swapped memory pages must happen as soon as possible, if not sooner! (ideally instantly -- which could be the case or close to the case if the page is sent through dedicated decompression hardware!) Anyway, LZ0 (if the decompression is fast enough!) might make a great swap memory page compressor/decompressor!
Has the compressed format stabilized? As in: if you were to write a decoder now, could you rely on it to decode data compressed with encoder released a few years from now?
Or is decoding still (somewhat) in a state of flux? (I'm thinking of an MPEG-style situation where decoding is stable & standardized while ENcoders continue to be improved years after)
Well, the fact is that in the LZ4 bitstream, offsets are hard-coded as 16-bit integers (2-byte uint16_t). It is physically impossible for LZ4 to reference a byte located more than 65,535 bytes back. So, on a 1.3 MB binary (bash_x86_64 for example) or a 5 MB blob, LZ4 is blind to long-range repetitions. On blob_png_5m.bin, LZ0 Ultra beats LZ4HC by 830 KB because LZ0 can reference chunks of duplicated image data located several megabytes apart.
Furthermore, in LZ4, every token costs 1 byte, every offset costs a full 2 bytes, and every length extension costs 1 extra byte. In contrast, in LZ0, the Literal vs Match decision takes a single bit. Reusing the same offset costs only 1 bit plus the Elias-encoded length. Offsets are encoded with Elias gamma + 7 trailing LSB bits, and reusing a recent offset often costs 4 to 8 bits total in LZ0, versus a minimum of 24 bits in LZ4.
Also, LZ4 produces some inflation (expansion under 1%, however) on JPG, PNG, or already-compressed data. LZ0 has virtually zero inflation and does not corrupt the ratio on multimedia files.
That said, let's not forget that LZ4 decompresses faster than LZ0 (byte-aligned format with no bit shifting). But compared with the dense compressors in its category (ZX0, UPKR, ...), LZ0 offers the density of an optimal unbounded-window compressor while approaching LZ4-class throughput (well, within a factor of 2x to 4x, versus lagging ~30x to 100x for ZX0/UPKR).
Comments (21) 11 threads
Move complexity from the decoder to the encoder."
Great idea!
Also, LZ0 might be great for compressing a computer's unused (aka "swap") virtual memory pages, i.e., like ZRAM, because if we think about the usage paradigm for that, the compress phase doesn't need to be time-bound, that is, page compression (if properly implemented) could use simply unused CPU cycles... i.e., not time bound if it doesn't need to be compressed and stored immediately...
Decompression on the other hand (i.e., the page is needed by the computer) is a completely different story! Every nanosecond that a computer has to wait for a requested page costs the program which needs it, TIME! That is, the program (or thread(s) requiring that memory) are typically halted until it becomes available!
So decompression of requested previously unused swapped memory pages must happen as soon as possible, if not sooner! (ideally instantly -- which could be the case or close to the case if the page is sent through dedicated decompression hardware!)
Anyway, LZ0 (if the decompression is fast enough!) might make a great swap memory page compressor/decompressor!
Or is decoding still (somewhat) in a state of flux?
(I'm thinking of an MPEG-style situation where decoding is stable & standardized while ENcoders continue to be improved years after)
All comments shown.
Couldn't load more comments. Check your connection and try again.