[pacman-dev] Feature: -T0 flag as default ZSTDCOMPRESSION arg

Frederik Enste frederik at fenste.de
Tue Feb 9 22:10:53 UTC 2021

Hello pacman devs,

today I installed a big package from the AUR on a clean system and 
forgot to adjust the makepkg.conf beforehand.
As makepkg.conf is set up to compresses all packages with zstd before 
installing them onto the system the compression took a while.

Because of that, I would like to add the -T0 flag to the list of default 
This would allow zstd to spawn multiple compression flags (equal to the 
number of physical processors) and thus speed up package compression.

I have created a simple patch for this feature but as this is my first 
contribution to this project I am not entirely sure that I adjusted all 
necessary files:

 From 6a8d811fbced5a799d88ee357d4b0c694d79e0f7 Mon Sep 17 00:00:00 2001
From: Frederik Enste <frederik at fenste.de>
Date: Tue, 9 Feb 2021 22:43:56 +0100
Subject: [PATCH] added -T0 flag to default zstd compression

Signed-off-by: Frederik Enste <frederik at fenste.de>
  doc/makepkg.conf.5.asciidoc | 2 +-
  etc/makepkg.conf.in         | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/makepkg.conf.5.asciidoc b/doc/makepkg.conf.5.asciidoc
index 04cc5ea9..40129a01 100644
--- a/doc/makepkg.conf.5.asciidoc
+++ b/doc/makepkg.conf.5.asciidoc
@@ -259,7 +259,7 @@ Options
  **COMPRESSGZ=**"(gzip -c -f -n)"::
  **COMPRESSBZ2=**"(bzip2 -c -f)"::
  **COMPRESSXZ=**"(xz -c -z -)"::
-**COMPRESSZST=**"(zstd -c -z -)"::
+**COMPRESSZST=**"(zstd -c -z -T0 -)"::
  **COMPRESSLZO**"(lzop -q)"::
  **COMPRESSLRZ=**"(lrzip -q)"::
  **COMPRESSLZ4=**"(lz4 -q)"::
diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index b13b1d5d..8d655bf8 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -133,7 +133,7 @@ DBGSRCDIR="/usr/src/debug"
  COMPRESSGZ=(gzip -c -f -n)
  COMPRESSBZ2=(bzip2 -c -f)
  COMPRESSXZ=(xz -c -z -)
-COMPRESSZST=(zstd -c -z -q -)
+COMPRESSZST=(zstd -c -z -q -T0 -)
  COMPRESSLRZ=(lrzip -q)
  COMPRESSLZO=(lzop -q)
  COMPRESSZ=(compress -c -f)

Of course, I would understand if this "feature" is not important or 
requested by other users as everybody could change the makepkg.conf in 
seconds but please let me know what you think about this.

Best regards,
Frederik Enste

More information about the pacman-dev mailing list