appliance-tools/0001-Enable-multi-thread-su...

37 lines
1.4 KiB
Diff

From c7937b1115fb30c8ca23460c0af0c652708f2da5 Mon Sep 17 00:00:00 2001
From: David Abdurachmanov <david.abdurachmanov@gmail.com>
Date: Wed, 13 Jun 2018 13:25:49 +0200
Subject: [PATCH] Enable multi-thread support in xz compression
xz-utils starting 5.2.0 (2014-12-21) support multi-threaded compression.
This version was added to Fedora 22 (2015-01-07) and also available in
CentOS 7.
-T 0 allows xz to use all available cores on the system assuming input
file is big enough and there is enough memory on the system.
Tested on SiFive HiFive Unleashed (RISC-V, riscv64) with Fedora and it
showed significant time savings.
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
---
appcreate/appliance.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/appcreate/appliance.py b/appcreate/appliance.py
index 34971a3..70428b7 100644
--- a/appcreate/appliance.py
+++ b/appcreate/appliance.py
@@ -643,7 +643,7 @@ class ApplianceImageCreator(ImageCreator):
if self.__compress:
# Compress with xz using 16 MiB block size for seekability
- rc = subprocess.call(["xz", "-z", "--block-size=16777216", src])
+ rc = subprocess.call(["xz", "-z", "--block-size=16777216", "-T 0", src])
if rc == 0:
logging.debug("compression successful")
if rc != 0:
--
2.17.2