Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can a XOR-only decompressor do the standard LZ77 trick of encoding many repeated bytes with a copy operation that refers to not-yet-decompressed data? It seems to me that you'd have to have a lot of 0 patch bytes for that. Huffman coding could encode all the 0 bytes in 1 bit each, but that still loses over regular LZ77. It seems to me that you still might want to keep "COPY" around for RLE-style data.


yes, since that is about how you handle the offsets most of the time. At most you just have an instruction for source side, and one for target side. I will say however, this is useful for files, but not for deltas, as it makes delta composability much more complicated, and also makes streaming harder.

(IE with only original-source copies, and a->delta1->delta2->delta3->b, composing delta1/2/3 prior to applying them is easy and simple to reason about. If you allow target side copies, it is a lot messier)

Way back in the day, when i upgraded subversion's delta format, i did a lot of work on testing out various mechanisms - in practice, target side copies were much worse, and much more expensive to process, than doing source-only copies and then zlib'ing the delta instructions + new data ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: