summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-10-26 00:15:16 +0200
committerGitHub <noreply@github.com>2022-10-25 22:15:16 +0000
commitb538acb2a9ea93fc475577883c6b60c7a8f1a591 (patch)
treebec3f1340c26ff86e5e7f592b038890468152d04 /lib
parent8aa975802454f453b09707c98ee1023bb220b992 (diff)
downloadspack-b538acb2a9ea93fc475577883c6b60c7a8f1a591.tar.gz
spack-b538acb2a9ea93fc475577883c6b60c7a8f1a591.tar.bz2
spack-b538acb2a9ea93fc475577883c6b60c7a8f1a591.tar.xz
spack-b538acb2a9ea93fc475577883c6b60c7a8f1a591.zip
binary_distribution: compress level 9 -> 6 (#33513)
Use the same compression level as `gzip` (6) instead of what Python uses (9). The LLVM tarball takes 4m instead of 12m to create, and is <1% larger. That's not worth the wait...
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/binary_distribution.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py
index d8ac0bb1fa..d22572d8a4 100644
--- a/lib/spack/spack/binary_distribution.py
+++ b/lib/spack/spack/binary_distribution.py
@@ -1161,7 +1161,11 @@ def _build_tarball(
tty.die(e)
# create gzip compressed tarball of the install prefix
- with closing(tarfile.open(tarfile_path, "w:gz")) as tar:
+ # On AMD Ryzen 3700X and an SSD disk, we have the following on compression speed:
+ # compresslevel=6 gzip default: llvm takes 4mins, roughly 2.1GB
+ # compresslevel=9 python default: llvm takes 12mins, roughly 2.1GB
+ # So we follow gzip.
+ with closing(tarfile.open(tarfile_path, "w:gz", compresslevel=6)) as tar:
tar.add(name="%s" % workdir, arcname="%s" % os.path.basename(spec.prefix))
# remove copy of install directory
shutil.rmtree(workdir)