From b538acb2a9ea93fc475577883c6b60c7a8f1a591 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 26 Oct 2022 00:15:16 +0200 Subject: [PATCH] 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... --- lib/spack/spack/binary_distribution.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index d8ac0bb1fa0..d22572d8a41 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)