SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Compiled from git today. While some data store scenarios benefit by squeezing every last KB they are almost always 'compress once, read forever'. You probably don't want to swap out for brotli just yet. I was curious given all the somewhat misleading coverage.
So all that noise these days for brotli was for nothing or such.
BTW, with "pixz" the XZ implementation is even more quicker, pixz is the fastest parallelized implementation of LZMA2 (works on top of xz-utils libraries), scales up to N cores both for encoding and decoding, plus the archives made remain in specification.
The single thread was 8% slower than v5.0.5, but it does scale nicely. I'll try the multi-threaded xz on my DVD VOBs to see if the speed/compression is worth replacing pigz. ABs libreoffice package is a good mix of binary, text and small png images, fyi.
Cheers,
UPDATE:
VOBs remain difficult to compress, xz is not better.
The comparison with XZ seems to have gotten a lot of emphasis but that is not the key point IMHO. Brotli's strength is in compression sizes and times for serving data on the web. Here it is competing with "Content-Encoding: gzip".
In my own very quick test, Brotli destroys GZip in compression size and times to compress and decompress, using the contents of Chrome 46.0.2490.71 for 64bit Linux as a source of files. The key is to set a compression quality level lower than the default.
First, I'll grab the latest Chrome and extract the cpio archive out of it:
$ time gzip -9k google-chrome-stable-46.0.2490.71-1.cpio
real 0m32.913s
user 0m32.849s
sys 0m0.094s
$ time bro --quality 1 --input google-chrome-stable-46.0.2490.71-1.cpio > google-chrome-stable-46.0.2490.71-1.cpio.br
real 0m2.309s
user 0m2.235s
sys 0m0.075s
$ ls -lh google-chrome-stable-46.0.2490.71-1.cpio.{br,gz}
-rw-r--r-- 1 ruario users 62M Oct 19 09:03 google-chrome-stable-46.0.2490.71-1.cpio.br
-rw-r--r-- 1 ruario users 63M Oct 19 09:00 google-chrome-stable-46.0.2490.71-1.cpio.gz
$ time gzip -cd google-chrome-stable-46.0.2490.71-1.cpio.gz > /dev/null
real 0m1.577s
user 0m1.566s
sys 0m0.013s
$ time bro --decompress --input google-chrome-stable-46.0.2490.71-1.cpio.br > /dev/null
real 0m0.836s
user 0m0.815s
sys 0m0.021s
Note: This is a Lenovo Yoga 3 running Slackware-current. Not that that it matters too much as it is the relative times that are important. In addition, I have provided the commands I ran so you are free to retest on your own hardware.
A quick follow up comparing with BZip2, setting a quality level of 5 (so that compression level is close to BZip2's 9)
Code:
$ time bzip2 -9k google-chrome-stable-46.0.2490.71-1.cpio
real 0m22.209s
user 0m22.110s
sys 0m0.076s
$ time bro --quality 5 --input google-chrome-stable-46.0.2490.71-1.cpio > google-chrome-stable-46.0.2490.71-1.cpio.br
real 0m9.762s
user 0m9.665s
sys 0m0.107s
$ ls -lh google-chrome-stable-46.0.2490.71-1.cpio.{br,bz2}
-rw-r--r-- 1 ruario users 56M Oct 19 09:09 google-chrome-stable-46.0.2490.71-1.cpio.br
-rw-r--r-- 1 ruario users 58M Oct 19 09:00 google-chrome-stable-46.0.2490.71-1.cpio.bz2
$ time bzip2 -cd google-chrome-stable-46.0.2490.71-1.cpio.bz2 > /dev/null
real 0m8.765s
user 0m8.749s
sys 0m0.024s
$ time bro --decompress --input google-chrome-stable-46.0.2490.71-1.cpio.br > /dev/null
real 0m0.799s
user 0m0.789s
sys 0m0.011s
You will note that even with quality 5, Brotli is still out performing GZip from my previous test in all regards!
Following up to compare with XZ for the sake of it and indeed for this sample of data, Brotli cannot match the compression size of XZ and takes a relatively long time to complete. However, this is not the type of data Brotli has been optimised for since it contains large binaries, while Brotli is designed to work with text files like HTML, CSS and JavaScript. In addition, while compression is slower you would expect this to happen once, whereas the data would be decompressed by the receiving clients (browsers) multiple times. Hence decompression times should be strongly favoured. As you can see Brotli is much faster than XZ at decompressing this collection of files on my system (In fact even at quality 11, it is still faster than GZip):
Code:
$ time xz -9k google-chrome-stable-46.0.2490.71-1.cpio
real 1m52.666s
user 1m52.081s
sys 0m0.686s
$ time bro --quality 11 --input google-chrome-stable-46.0.2490.71-1.cpio > google-chrome-stable-46.0.2490.71-1.cpio.br
real 13m14.687s
user 13m9.831s
sys 0m5.521s
$ ls -lh google-chrome-stable-46.0.2490.71-1.cpio.{br,xz}
-rw-r--r-- 1 ruario users 48M Oct 19 09:49 google-chrome-stable-46.0.2490.71-1.cpio.br
-rw-r--r-- 1 ruario users 45M Oct 19 09:00 google-chrome-stable-46.0.2490.71-1.cpio.xz
$ time xz -cd google-chrome-stable-46.0.2490.71-1.cpio.xz > /dev/null
real 0m4.054s
user 0m4.023s
sys 0m0.035s
$ time bro --decompress --input google-chrome-stable-46.0.2490.71-1.cpio.br > /dev/null
real 0m0.955s
user 0m0.936s
sys 0m0.020s
In summary, no Brotli is not some wonder compressor that beats XZ in all cases but I suspect that it probably better than XZ for its intended use case (good compression of text files and with very quick decompression). It is also a better general compressor when comparing with GZip and BZip2. It could also be interesting in packaging. Consider that SBo packages are usualy created as .tgz for speed. Using .tbr with quality level 1 through 5 would be faster and result in smaller packages. You might even find a case for using Brotil for packages on Linux install media using quality level 11. You would get something close to XZ in terms of absolute size but install should be quicker because of vastly better decompression times.
You might even find a case for using Brotil for packages on Linux install media using quality level 11. You would get something close to XZ in terms of absolute size but install should be quicker because of vastly better decompression times.
If I may digress a bit: maybe using a package manager like slpkg can bring even higher speeds that changing the compression app? But these two ways are not mutually exclusive, I assume.
So all that noise these days for brotli was for nothing or such.
Not for nothing. It is a great compressor and appears to handily beat GZip and BZip2 in terms of size and speed. These might not be "cutting edge" compression formats these days but they are widespread, particularly gzip for content encoding on the web and Brotli is aimed at replacing some of that. XZ/LZMA could have been a contender for this if it wasn't so slow at decompression. GZip/Deflate's decompression speed (with "relatively" good compression) is the reason why it is still widespread. Zopfli was interesting in the industry because it achieved a minor improvement in compression, whilst retaining good decompression speed. If you have ever tried it, you will know that Zopfli takes an "age" to compress data but few care because the end size and decompression speed are the points most cared about for use on the web. Brotli destroys Zopfli for this specific use case.
Quote:
Originally Posted by lazardo
The industry noise is unusually misleading given it is not the pied piper-esq solution that I've seen emphasized.
I think that the problem is reporters wanting a juicy headline. Brotli is a very decent compression format for its intended use case.
If I may digress a bit: maybe using a package manager like slpkg can bring even higher speeds that changing the compression app? But these two ways are not mutually exclusive, I assume.
Indeed, they are not mutually exclusive at all. Also I wasn't just thinking about Slackware. XZ is a currently the "gold standard" for package compression on all distros. It results in small files that are relative quick to decompress. Brotli is almost as small and much quicker to decompress. It would be interesting to see if any of the distros consider it for packaging.
This got me interested so I did some tests. I compared all different quality settings for gzip, xz (default versions in slackware 14.1) and brotli (version 0.2.0).
Ran the tests on three files:
1. A gslapt package (~ 760K uncompressed)
2. A package of brotli itself (~ 1.9MB uncompressed)
3. A firefox package (~ 87MB uncompressed)
Here's what I found. Sizes are in KB, times in seconds. All tests were made on an Intel NUC with an i3 CPU and slackware64 14.1.
So, at least for these packages, it seems that brotli is not able to reach as small package sizes as xz, even in its higher settings. But compression and decompression times are very interesting, as both are a lot faster than even gzip, with better compression ratios in all cases. From these tests, I'd say it makes brotli a very strong contender for replacing gzip.
Last edited by gapan; 10-20-2015 at 02:51 PM.
Reason: Add bro -10 and -11
This got me interested so I did some tests. I compared all different quality settings for gzip, xz (default versions in slackware 14.1) and brotli (version 0.2.0).
Actually, Brotli goes to 11! No really, it does. It's top quality setting is 11.
Using a crappy machine I had to hand I did a quick test compressing Firefox, with maximum settings. Now you see how slow Brotli 11 is at compression. However, it is close to XZ in size and much quicker on decompression.
Code:
$ wget -q http://ftp.slackware.no/slackware/slackware64-14.1/patches/packages/mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.txz
$ xz -d mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.txz
$ time xz -k9 mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar
real 0m56.512s
user 0m56.293s
sys 0m0.258s
$ time bro --quality 11 --input mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar --output mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar.br
real 8m2.319s
user 7m56.916s
sys 0m5.549s
$ ls -lh mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar*
-rw-r--r-- 1 ruario users 101M Sep 22 21:05 mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar
-rw------- 1 ruario users 42M Oct 20 20:16 mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar.br
-rw-r--r-- 1 ruario users 41M Sep 22 21:05 mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar.xz
$ time xz -cd mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar.xz > /dev/null
real 0m2.581s
user 0m2.552s
sys 0m0.027s
$ time bro --decompress --input mozilla-firefox-38.3.0esr-x86_64-1_slack14.1.tar.br > /dev/null
real 0m0.676s
user 0m0.660s
sys 0m0.016s
Actually, Brotli goes to 11! No really, it does. It's top quality setting is 11.
Hahah! I didn't know that! I just assumed it goes up to 9 as everything else does. Going up to 11 at least makes it louder than everything else!
Anyway, I have added quality settings 10 and 11 in my previous results. They both look very similar. At the same time they are very different from lower settings. Encoding times are indeed a lot slower, but sizes now are at the same level as xz -9, sometimes a bit smaller, sometimes a bit larger. But decompression times are a lot faster still.
OK, so I got really interested. I added (experimental) support for installing/upgrading .tbr packages in spkg. x86_64 package only for now here: http://people.salixos.org/gapan/spkg/
There's still the matter of creating the .tbr packages in the first place of course. For now, you can convert existing .txz packages with a combination of:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.