[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: use an optimal-for-coreutils xz compression setting

From: Jim Meyering
Subject: [PATCH] maint: use an optimal-for-coreutils xz compression setting
Date: Sat, 03 Mar 2012 13:08:58 +0100


Note that for this to be effective, the person running "make stable",
"make alpha" or "make beta" must use the from yesterday's gnulib
(v0.0-7095-geb21377 or newer), which eliminates a hard-coded XZ_OPT=-9e
in the distribution tarball-building rule.  You should also
be using a version of automake that is new enough to provide
this rule, with its overridable XZ_OPT setting:

  tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c 

>From 32c71fd74e050206b34df045908821264d7c3fe9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 3 Mar 2012 09:41:31 +0100
Subject: [PATCH] maint: use an optimal-for-coreutils xz compression setting

* Set XZ_OPT = -8e (determined empirically).
This sacrifices 8 KiB of compressed tarball size for a 32-MiB
decrease in the memory required during decompression.  I.e.,
using -9e would shave off only 8 KiB from the tar.xz file, yet
would force every decompression process to use 32 MiB more memory.
--- |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ b/
index b4bd222..a5d129e 100644
--- a/
+++ b/
@@ -31,6 +31,20 @@ bootstrap-tools = autoconf,automake,gnulib,bison
 # Now that we have better tests, make this the default.
 export VERBOSE = yes

+# Comparing tarball sizes compressed using different xz presets, we see that
+# an -8e-compressed tarball is only 9KiB larger than the -9e-compressed one.
+# Using -8e is preferred, since that lets the decompression process use half
+# the memory (32MiB rather than 64MiB).
+# $ for i in {7,8,9}{e,}; do \
+#     (n=$(xz -$i < coreutils-8.15*.tar|wc -c);echo $n $i) & done |sort -nr
+# 5129388 7
+# 5036524 7e
+# 5017476 8
+# 5010604 9
+# 4923016 8e
+# 4914152 9e
+export XZ_OPT = -8e
 old_NEWS_hash = c2d954b7c19745272321cc4c4b676993

 # Add an exemption for sc_makefile_at_at_check.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]