Skip to content

Instantly share code, notes, and snippets.

@beci
Last active May 15, 2024 22:21
Show Gist options
  • Save beci/c737c89685a667053fe02f986d59ca44 to your computer and use it in GitHub Desktop.
Save beci/c737c89685a667053fe02f986d59ca44 to your computer and use it in GitHub Desktop.
Speed up compiling of AUR packages in arch linux

Edit /etc/makepkg.conf

replace in CFLAGS and CXXFLAGS to use the native one

-march=x86-64 -mtune=generic to -march=native

speed up build by set multiple threads

MAKEFLAGS="-j$(nproc)"

### speedup package compression for XZ 1. use less aggressive compression. -0 is the faster, I prefer -2 (default is -6) 2. use all available thread -T0 (or -T8 for 8 threads)

COMPRESSXZ=(xz -c -z -) to COMPRESSXZ=(xz -c -z -2 -T0 -)

As the default package extension became zst PKGEXT='.pkg.tar.zst', the compression isn't hurt badly anymore, but it can be speed up by add the desired level to COMPRESSZST, like add -1:

COMPRESSZST=(zstd -1 -c -z -q -)
@muradbu
Copy link

muradbu commented Aug 3, 2022

Thanks a lot!

@emilwojcik93
Copy link

emilwojcik93 commented May 23, 2023

Hi, I rewrited these params changes as shell script in this public repo

@Milor123
Copy link

Milor123 commented Oct 25, 2023

Hi, I rewrited these params changes as shell script in this public repo

Thanks man ❤️ ❤️ ❤️ ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment