regularize options which control size/speed trade
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/archival/Config.src b/archival/Config.src
index 9f49081..885cb5b 100644
--- a/archival/Config.src
+++ b/archival/Config.src
@@ -187,15 +187,17 @@
help
Enable use of long options, increases size by about 106 Bytes
-config GZIP_BIG_MEM
- bool "Trade memory for gzip speed"
- default n
- depends on GZIP
- help
- Enable big memory options for gzip, including larger I/O
- buffers and bigger hash tables. Faster, but uses at least
- twice as much memory. Select if speed is more important than
- memory use.
+config GZIP_FAST
+ int "Trade memory for gzip speed (0:small,slow - 2:fast,big)"
+ default 0
+ range 0 2
+ depends on GZIP
+ help
+ Enable big memory options for gzip.
+ 0: small buffers, small hash-tables
+ 1: larger buffers, larger hash-tables
+ 2: larger buffers, largest hash-tables
+ Larger models may give slightly better compression
config LZOP
bool "lzop"
@@ -340,15 +342,12 @@
is generally considerably better than that achieved by the bzip2
compressors.
- The BusyBox unlzma applet is limited to de-compression only.
+ The BusyBox unlzma applet is limited to decompression only.
On an x86 system, this applet adds about 4K.
- Unless you have a specific application which requires unlzma, you
- should probably say N here.
-
config FEATURE_LZMA_FAST
bool "Optimize unlzma for speed"
- default y
+ default n
depends on UNLZMA
help
This option reduces decompression time by about 25% at the cost of
diff --git a/archival/bzip2.c b/archival/bzip2.c
index e39d7f7..3dde970 100644
--- a/archival/bzip2.c
+++ b/archival/bzip2.c
@@ -19,7 +19,7 @@
#include "libbb.h"
#include "archive.h"
-#define CONFIG_BZIP2_FEATURE_SPEED 1
+#define CONFIG_BZIP2_FAST 1
/* Speed test:
* Compiled with gcc 4.2.1, run on Athlon 64 1800 MHz (512K L2 cache).
@@ -27,7 +27,7 @@
* (time to compress gcc-4.2.1.tar is 126.4% compared to bbox).
* At SPEED 5 difference is 32.7%.
*
- * Test run of all CONFIG_BZIP2_FEATURE_SPEED values on a 11Mb text file:
+ * Test run of all CONFIG_BZIP2_FAST values on a 11Mb text file:
* Size Time (3 runs)
* 0: 10828 4.145 4.146 4.148
* 1: 11097 3.845 3.860 3.861
diff --git a/archival/gzip.c b/archival/gzip.c
index 0e0b681..3af930b 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -81,10 +81,14 @@
/* ===========================================================================
*/
-#if ENABLE_GZIP_BIG_MEM
+#if CONFIG_GZIP_FAST == 0
+# define SMALL_MEM
+#elif CONFIG_GZIP_FAST == 1
+# define MEDIUM_MEM
+#elif CONFIG_GZIP_FAST == 2
# define BIG_MEM
#else
-# define SMALL_MEM
+# error "Invalid CONFIG_GZIP_FAST value"
#endif
#ifndef INBUFSIZ
diff --git a/archival/libarchive/bz/blocksort.c b/archival/libarchive/bz/blocksort.c
index f70c370..e600cb7 100644
--- a/archival/libarchive/bz/blocksort.c
+++ b/archival/libarchive/bz/blocksort.c
@@ -385,7 +385,7 @@
* but speeds up compression 10% overall
*/
-#if CONFIG_BZIP2_FEATURE_SPEED >= 1
+#if CONFIG_BZIP2_FAST >= 1
#define TIMES_8(code) \
code; code; code; code; \
@@ -496,7 +496,7 @@
i++;
/* 1.5% overall speedup, +290 bytes */
-#if CONFIG_BZIP2_FEATURE_SPEED >= 3
+#if CONFIG_BZIP2_FAST >= 3
/*-- copy 2 --*/
if (i > hi) break;
v = ptr[i];
@@ -750,7 +750,7 @@
j = block[0] << 8;
i = nblock - 1;
/* 3%, +300 bytes */
-#if CONFIG_BZIP2_FEATURE_SPEED >= 2
+#if CONFIG_BZIP2_FAST >= 2
for (; i >= 3; i -= 4) {
quadrant[i] = 0;
j = (j >> 8) | (((uint16_t)block[i]) << 8);
@@ -787,7 +787,7 @@
s = block[0] << 8;
i = nblock - 1;
-#if CONFIG_BZIP2_FEATURE_SPEED >= 2
+#if CONFIG_BZIP2_FAST >= 2
for (; i >= 3; i -= 4) {
s = (s >> 8) | (block[i] << 8);
j = ftab[s] - 1;
diff --git a/archival/libarchive/bz/bzlib_private.h b/archival/libarchive/bz/bzlib_private.h
index 6430ce4..43e674b 100644
--- a/archival/libarchive/bz/bzlib_private.h
+++ b/archival/libarchive/bz/bzlib_private.h
@@ -183,7 +183,7 @@
/* stack-saving measures: these can be local, but they are too big */
int32_t sendMTFValues__code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
int32_t sendMTFValues__rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
-#if CONFIG_BZIP2_FEATURE_SPEED >= 5
+#if CONFIG_BZIP2_FAST >= 5
/* second dimension: only 3 needed; 4 makes index calculations faster */
uint32_t sendMTFValues__len_pack[BZ_MAX_ALPHA_SIZE][4];
#endif
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c
index f936717..e9f1afd 100644
--- a/archival/libarchive/bz/compress.c
+++ b/archival/libarchive/bz/compress.c
@@ -61,7 +61,7 @@
/*---------------------------------------------------*/
static
/* Helps only on level 5, on other levels hurts. ? */
-#if CONFIG_BZIP2_FEATURE_SPEED >= 5
+#if CONFIG_BZIP2_FAST >= 5
ALWAYS_INLINE
#endif
void bsW(EState* s, int32_t n, uint32_t v)
@@ -331,7 +331,7 @@
for (v = 0; v < alphaSize; v++)
s->rfreq[t][v] = 0;
-#if CONFIG_BZIP2_FEATURE_SPEED >= 5
+#if CONFIG_BZIP2_FAST >= 5
/*
* Set up an auxiliary length table which is used to fast-track
* the common case (nGroups == 6).
@@ -361,7 +361,7 @@
*/
for (t = 0; t < nGroups; t++)
cost[t] = 0;
-#if CONFIG_BZIP2_FEATURE_SPEED >= 5
+#if CONFIG_BZIP2_FAST >= 5
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
register uint32_t cost01, cost23, cost45;
@@ -420,7 +420,7 @@
* Increment the symbol frequencies for the selected table.
*/
/* 1% faster compress. +800 bytes */
-#if CONFIG_BZIP2_FEATURE_SPEED >= 4
+#if CONFIG_BZIP2_FAST >= 4
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
#define BZ_ITUR(nn) s->rfreq[bt][mtfv[gs + (nn)]]++
diff --git a/archival/libarchive/bz/huffman.c b/archival/libarchive/bz/huffman.c
index 676b1af..bbec11a 100644
--- a/archival/libarchive/bz/huffman.c
+++ b/archival/libarchive/bz/huffman.c
@@ -48,7 +48,7 @@
/* 90 bytes, 0.3% of overall compress speed */
-#if CONFIG_BZIP2_FEATURE_SPEED >= 1
+#if CONFIG_BZIP2_FAST >= 1
/* macro works better than inline (gcc 4.2.1) */
#define DOWNHEAP1(heap, weight, Heap) \