bug-grep
[Top][All Lists]
Advanced

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

[PATCH 2/2] maint: use an optimal-for-grep xz compression setting


From: Jim Meyering
Subject: [PATCH 2/2] maint: use an optimal-for-grep xz compression setting
Date: Sat, 03 Mar 2012 11:14:33 +0100

FYI,

>From 3db1e8238af7201b991c34dd51e156b852be3304 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 3 Mar 2012 10:48:51 +0100
Subject: [PATCH 1/2] build: update gnulib submodule to latest

---
 gnulib |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index 9a25aef..eb21377 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 9a25aef6918949dd5c7f5e9209409db9aa5b145b
+Subproject commit eb213779301aa663ab84ac947e8e181e9ad554d0
--
1.7.9.2.324.g1221


>From 4b2224681fbc297bf585630b679d8540a02b78d3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 3 Mar 2012 10:51:11 +0100
Subject: [PATCH 2/2] maint: use an optimal-for-grep xz compression setting

* cfg.mk (XZ_OPT): Use -6e (determined empirically, see comments).
This sacrifices a meager 60 bytes of compressed tarball size for a
55-MiB decrease in the memory required during decompression.  I.e.,
using -9e would shave off only 60 bytes from the tar.xz file, yet
would force every decompression process to use 55 MiB more memory.
---
 cfg.mk |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index 08bb156..84115c2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -31,6 +31,26 @@ bootstrap-tools = autoconf,automake,gnulib
 # Now that we have better tests, make this the default.
 export VERBOSE = yes

+# Comparing tarball sizes compressed using different xz presets, we see
+# that -6e adds only 60 bytes to the size of the tarball, yet reduces
+# (from -9) the decompression memory requirement from 64 MiB to 9 MiB.
+# Don't be tempted by -5e, since -6 and -5 use the same dictionary size.
+# $ for i in {4,5,6,7,8,9}{e,}; do \
+#     (n=$(xz -$i < grep-2.11.tar|wc -c);echo $n $i) & done |sort -nr
+# 1236632 4
+# 1162564 5
+# 1140988 4e
+# 1139620 6
+# 1139480 7
+# 1139480 8
+# 1139480 9
+# 1129552 5e
+# 1127616 6e
+# 1127556 7e
+# 1127556 8e
+# 1127556 9e
+export XZ_OPT = -6e
+
 old_NEWS_hash = 347e90ee0ec0489707df139ca3539934

 # Many m4 macros names once began with `jm_'.
--
1.7.9.2.324.g1221



reply via email to

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