PSA: go to /etc/makepkg.conf and replace PKGEXT='pkg.tar.xz. with PKGEXT='pkg.tar' to get faster AUR packages building and installation.
It's kind of idiotic when you think about it, to heavily compress packages only to uncompress them one second later (if you're not a package builder). Source: https://wiki.archlinux.org/index.php/Makepkg#Use_other_compression_algorithms
EDIT: thank you all for your ideas
Edited 12 Jun 2019. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 102 · 100% up
- Kind
- Text
- ID
- bzgitj
45 comments
Try
PKGEXT='.pkg.tar.gz'. Good compression and fast.You can also install
pigz, the parallel implementation of gzip, and editCOMPRESSGZin/etc/makepkg.confto equal(pigz -c -f -n).or just edit
COMPRESSXZto equal(xz -c -z -T0 -)and leavePKGEXTas'.pkg.tar.xz'.pigz can cause your system to slow down while it's active if you give it all threads (of course xz -T0 will do the same)
If this is better, why isn't it default?
xz gives better compression. It's worth it for packagers to pay the extra cpu once to save everyone out there tons of bandwidth
It's not a direct upgrade, you trade a lot of space efficiency for a bit of speed and at that point you might as well use even faster algorithms like LZO.
You might actually be better off just enabling multithreading for XZ by adding
-T0toCOMPRESSXZin/etc/makepkg.confbecause gzip really isn't good by today's standards (warning: this breaks reproducibility).Arch as a whole will hopefully soon switch to ZSTD which is better than XZ in almost every way, especially in (de-)compression speeds (like, >10x).
We just have to wait until the people in charge feel confident enough that everyone's Arch installations are updated far enough to support the switch (you wouldn't be able to easily update your installation it's older than 2018-09).
It is not better, and the default will probably be changed to zstandard soon
It is the makepkg default. Just arch sets xz as its default.
Anyway there is no better. gzip is faster, while xz generates smaller files.
gzip was the default in 2010.
Because it's not better in the universal sense. It improves build times but makes packages larger. Neither of which is better in every case.
If you have a 4TB nvme ssd for the packages I doubt you care about the size (but you also probably have some insane cpu which can do xz -e9 -T0 (or -Tx where X is the number of thereads -8 so you still have 4c/8t for the rest... I mean if you have an 2990WX..) --verbose quickly.
Or, your know, just pass it as
PKGEXT='.pkg.tar' makepkg -sEDIT: This also only assumed the resulting packages are never stored on disk...they are.
makepkg -s -- PKGEXT='.pkg.tar'works too ;)I don't think any/all AUR helpers let you do that
Which is why you only use the well made ones.
It means that AUR packages will take more storage, but I did the same to save time
If you have already FS-compression enabled, maybe it's not so bad (compress=lzo on btrfs for example). I can't actually tell how good/bad it is, because btrfs(8) is a horrible tool (if someone has an idea, I'm all ears).
Just an FYI, but zstd has been supported in btrfs for a bit now, and should provide better performance and compression than lzo.
If you want to see a compression rate, you can use https://github.com/kilobyte/compsize
For example,
compsize /usr:After
btrfs filesystem defragment -r -v -czstd /usr, where some data was left as lzo from my original install.On HDD, using lzo compression would actually be faster than using no compression at all, because LZO compresses faster than HDD can write data down.
This is especially helpful when installing big third-party packages that arrive in an already-compressed form, such as IntelliJ and friends.
This is especially useful if you use a filesystem with transparent compression like BTRFS or ZFS.
Deleted before we saved it.
What I did to speed up compression was not to disable it, but to install "pixz" (which compresses with xz in parallel) and change a line in
/etc/makepkg.conf:just pass -T0 to xz for the same results there are no important speed differences
Huh, didn't realize xz actually supported this. Good to know, thanks!
EDIT: It seems that the difference between pixz and threaded xz is that pixz will create an index if the input file is a tar file, so it's easier to take specific files from the compressed tar file.
Unless you are a regular package builder / maintainer.
Depends on your CPU and bandwidth capacities
Deleted before we saved it.