3 ms·
As I suspected, XZ performs better at least for jquery. I was disappointed it was missing from benchmarks. For comparison on my machine: zopfli -i1000 takes [
by Jach 14y ago
As I suspected, XZ performs better at least for jquery. I was disappointed it was missing from benchmarks.
For comparison on my machine:
zopfli -i1000 takes [real, sys]=[1069ms, 21ms], 75730 bytes.
xz -9 takes [148ms, 15ms], 69476 bytes.
(Though as mentioned as a pro of zopfli, xz would lose on decompression speed for a larger file.)
- andrewf 14y agoYeah but the point here is to produce a .gz file which is compatible with standard tools like gunzip, PNG decoders, your browser's handling of "Content-Encoding: gzip", etc. If you control the compressor and decompressor then applying new tricks to producing a Deflate stream is far less interesting, just use a better compressor.
- Jach 14y agoCan we get browsers to support LZMA? :) (Hey, a bug report! https://bugzilla.mozilla.org/show_bug.cgi?id=366559 https://bugzilla.mozilla.org/show_bug.cgi?id=366559) But yeah, zopfli does seem like an excellent fit when you can't force a particular decompressor.
- EwanToo 14y agoand bzip2 gets it down to 65195 bytes. I've not used xz, I'm sure it's good, but the point isn't really about which compression algorithm is the best in the world, but which works best in the (depressingly limited) real world conditions.
- SageRaven 14y agoIf it is any indicator, current versions of FreeBSD and some Linux distros have "xz" as part of the base system, along with their gzip and bzip2 counterparts, including xzcat/xzless/etc., newsyslog/logrotate compression options for xz, xz-compressed tarballs for source distributions (tar.xz / txz), as well as binary packages for FreeBSD compressed with the format. LZMA compression has gained a lot of traction over the past few years.
- EwanToo 14y agoThanks - I meant to update my comment after I went and looked up xz, I've used 7zip and LZMA before, but I've never directly come across a .xz file, odd!