top | item 45496366

(no title)

d33 | 4 months ago

I've recently been wondering: could you re-compress gzip to a better compression format, while keeping all instructions that would let you recover a byte-exact copy of the original file? I often work with huge gzip files and they're a pain to work with, because decompression is slow even with zlib-ng.

discuss

order

mappu|4 months ago

precomp/antix/... are tools that can bruteforce the original gzip parameters and let you recreate the byte-identical gzip archive.

The output is something like {precomp header}{gzip parameters}{original uncompressed data} which you can then feed to a stronger compressor.

A major use case is if you have a lot of individually gzipped archives with similar internal content, you can precomp them and then use long-range solid compression over all your archives together for massive space savings.

Dylan16807|4 months ago

> A major use case is if you have a lot of individually gzipped archives with similar internal content, you can precomp them and then use long-range solid compression over all your archives together for massive space savings.

Or even a single gzipped archive with similar pieces of content that are more than 32KB apart.

o11c|4 months ago

That's called `pristine-gz`, part of the `pristine-tar` project.

d33|4 months ago

Thank you! It seems to be what I'm looking for.

artemisart|4 months ago

I may be misunderstanding the question but that should be just decompressing gzip & compressing with something better like zstd (and saving the gzip options to compress it back), however it won't avoid compressing and decompressing gzip.