2 ms·
tar.gz is not good with random access
by Aldo_MX 10y ago
tar.gz is not good with random access
- duskwuff 10y ago"Not good" is an understatement. tar.gz is maximally bad at random access -- there is no way to uncompress a single file, or to list files in the archive, without decompressing the entire gzip stream.
- Zardoz84 10y agoand gzip every file and tar it ? ie gz.tar
- duskwuff 10y agoGzipping each file individually makes the compressor have to start over with a fresh context on each file. This will result in a much worse compression ratio than if a single compressor is used for the whole archive, especially if the archive contains a lot of small, similar files. (Note that this is essentially what PKZIP does, though, so it's not awful.) Also, there are no tools I'm aware of that will handle that archive structure.
- mjevans 10y agoWhile a 'solid' archive wouldn't typically have the compression penalty or the 'listing' penalty it would still have the extraction penalty.
- cwmma 10y agoBut it's much better at streaming reads then zip so depending on the context might be better.