Smaller is not always better

Recently, I noticed that building packages from AUR–especially big packages–started taking a long time. makepkg was spending a lot of time in compressing files. After a bit of searching, I found that thsi was because Arch Linux switched from gz to xz as a compression format.

In principle, this move is a good step. xz takes 30% less space than gz. So, while installing binary packages, you download less bits at the cost of running your cpu at a higher speed for some time. However, when it comes to building packages from AUR, xz is horrible. xz superior compression comes at the cost of a drastic increase in the compression time (see here for a realistic test case). When building a package from AUR, you spend about 10 times more time to create the binary package using makepkg, and then spend three times more time to uncompress the package using pacman. All that to save 30% of space in /tmp/ that will be deleted at the next reboot.

I did not like this trade-off, so I have decided to revert to gz for the packages that I build on my system (and also for context-minimals-git package that I maintain). If you also want to do that, edit /etc/makepkg.conf and change




If you only want to change the compression format for a particular package, add the above line in the PKGBUILD.