logoalt Hacker News

mikepurvisyesterday at 12:53 AM1 replyview on HN

Could also maintain an in-memory index so that you can go back after the fact and extract individual files.


Replies

duskwuffyesterday at 12:58 AM

That's less helpful than you might imagine - gzip isn't seekable by default; if all you know is the seek point, you still have to decompress everything up to that point to start decompressing from there. And if you have to do that, reading the tar headers as you go isn't a serious burden.

What might help is saving the state of the decompressor periodically, rather than just the index in the file. But that's getting pretty far into the weeds for an optimization to an infrequently used feature.

show 1 reply