From 02ec10093dba52064c5be4c001109b19b11819eb Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 23 Jan 2025 11:33:26 +0100 Subject: [PATCH] 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 --- contrib/fedora/rpm/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index f46b9ba56e..cb2d72cde8 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -151,7 +151,7 @@ TEMPBASE="$(basename "$TEMP")" if [[ "$SOURCE_FROM_GIT" == "1" ]]; then mkdir -p "$TEMP/SOURCES" 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 LOG "VERSION=$VERSION"