One reason to use tar without gzip is that you can random access files within the tarball without unpacking it. tar + xz with --block-size also allows this.
> you can random access files within the tarball without unpacking it
Kinda sorta. You still need a linear scan first and remember all the offsets, because the tar format does not have an index.
> tar + xz with --block-size also allows this.
This also requires a linear scan + unpack stage first, with memorizing offsets. Remembering where the XZ blocks start (and corresponding uncompressed offsets) allows a sufficiently smart implementation to pretend that it can seek in the compressed stream, while under the hood seeking to the closest offset it has memorized and uncompressing from there. This is also alluded to in the GitHub issue you linked to.
Manually tuning down the block size allows that to be done faster, at the cost of compression.
But you still need an unpack/scan phase first. And potentially unpacking and skipping adjacent data when "randomly" accessing a file.
Technically, there is nothing stopping an implementation from doing this with gzip/zlib frames as well.
You only have to scan to the start of the file you want to unpack. In many cases (we use this with Kubernetes CDI) the tarball contains only a few files with the disk image we want to access taking up the majority of the tarball, so in fact a full linear scan is not required and we're only unpacking the first few blocks.
Both have to do a linear scan first though. The implementations however can do the linear scan on-demand, i.e., they scan only as far as needed.
bzip2 works very well with this approach. xz only works with this approach when compressed with multiple blocks. Similar is true for zstd.
For zstd, there also exists a seekable variant, which stores the block index at the end as metadata to avoid the linear scan. indexed_zstd offers random access to those files https://github.com/martinellimarco/indexed_zstd
I wrote pragzip and also combined all of the other random access compression backends in ratarmount to offer random access to TAR files that is magnitudes faster than archivemount: https://github.com/mxmlnkn/ratarmount
https://libguestfs.org/nbdkit-tar-filter.1.html https://libguestfs.org/nbdkit-xz-filter.1.html
Unfortunately zstd still does not:
https://github.com/facebook/zstd/issues/395#issuecomment-535...