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...
This commit is contained in:
Harmen Stoppels 2022-10-26 00:15:16 +02:00 committed by GitHub
parent 8aa9758024
commit b538acb2a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)