gz is supported everywhere and is good for portability.
xz is newer and is now widely or well supported. It is more complex than gzip with a lot of compression options.
This is not the only reason people cannot always use xz. xz can take a very long time to compress, rather than a trivial amount of time, so even if it can produce excellent results, it cannot always be chosen. Another weakness is that it can use a lot of memory, especially for compression. The more you want to compress the element, the longer it will take, and it will be exponentially with decreasing returns.
However, with compression level 1 for blobs in my experience, xz can often give much smaller results in less time than zlib at level 9. This can sometimes be a very significant difference, while zlib can be created by xz, xz can create a file half the size of the zlib file.
bzip2 is in a similar situation, but xz has much higher advantages and a strong window, where it works much better than everyone else.
jgmjgm Nov 02 '15 at 12:42 2015-11-02 12:42
source share