contrib/build.sh: use xz -1 compression level

This speeds up rpm/build.sh considerably making it no longer CPU bound
(training negligible amount of space for hundreds of megs of memory and
over ten seconds on an otherwise idle ThinkPad T14s Gen 1).

Here's how different levels compare:

             Time   Max. RSS  Result
  xz -0     3.89s   34,256KB     12M
  xz -1     3.94s  101,584KB    7.9M  <- new
  xz -2     6.16s  188,104KB    6.8M
  xz -3     8.02s  259,344KB    6.4M
  xz -4    11.02s  356,588KB    6.4M
  xz -5    13.83s  358,544KB    5.7M
  xz -6    18.81s  358,544KB    5.4M  <- old
  xz -7    18.19s  440,012KB    5.3M

             Time   Max. RSS  Result
  gzip -9   3.65s    2,008KB     12M
  bzip2 -9  4.23s    7,952KB    8.0M
This commit is contained in:
Lubomir Rintel 2025-01-23 11:33:26 +01:00
parent 36bc62309b
commit 02ec10093d

View file

@ -151,7 +151,7 @@ TEMPBASE="$(basename "$TEMP")"
if [[ "$SOURCE_FROM_GIT" == "1" ]]; then if [[ "$SOURCE_FROM_GIT" == "1" ]]; then
mkdir -p "$TEMP/SOURCES" mkdir -p "$TEMP/SOURCES"
SOURCE="$TEMP/SOURCES/NetworkManager-${VERSION}.tar.xz" SOURCE="$TEMP/SOURCES/NetworkManager-${VERSION}.tar.xz"
(cd "$GITDIR" && git archive --prefix="NetworkManager-$VERSION"/ "$COMMIT_FULL") | xz > "$SOURCE" (cd "$GITDIR" && git archive --prefix="NetworkManager-$VERSION"/ "$COMMIT_FULL") | xz -1 > "$SOURCE"
fi fi
LOG "VERSION=$VERSION" LOG "VERSION=$VERSION"