diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-09-10 13:25:57 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-09-10 13:25:57 +0200 |
commit | 522041ee7b10ac544b90c6a8d1d4fbf8a5d39c6d (patch) | |
tree | 412854af83f841f564faf842ca6cefc12a016236 /archival | |
parent | 202a1b9284fd763e81340050d228103aef999675 (diff) | |
download | busybox-w32-522041ee7b10ac544b90c6a8d1d4fbf8a5d39c6d.tar.gz busybox-w32-522041ee7b10ac544b90c6a8d1d4fbf8a5d39c6d.tar.bz2 busybox-w32-522041ee7b10ac544b90c6a8d1d4fbf8a5d39c6d.zip |
regularize options which control size/speed trade
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r-- | archival/Config.src | 27 | ||||
-rw-r--r-- | archival/bzip2.c | 4 | ||||
-rw-r--r-- | archival/gzip.c | 8 | ||||
-rw-r--r-- | archival/libarchive/bz/blocksort.c | 8 | ||||
-rw-r--r-- | archival/libarchive/bz/bzlib_private.h | 2 | ||||
-rw-r--r-- | archival/libarchive/bz/compress.c | 8 | ||||
-rw-r--r-- | archival/libarchive/bz/huffman.c | 2 |
7 files changed, 31 insertions, 28 deletions
diff --git a/archival/Config.src b/archival/Config.src index 9f4908178..885cb5bcc 100644 --- a/archival/Config.src +++ b/archival/Config.src | |||
@@ -187,15 +187,17 @@ config FEATURE_GZIP_LONG_OPTIONS | |||
187 | help | 187 | help |
188 | Enable use of long options, increases size by about 106 Bytes | 188 | Enable use of long options, increases size by about 106 Bytes |
189 | 189 | ||
190 | config GZIP_BIG_MEM | 190 | config GZIP_FAST |
191 | bool "Trade memory for gzip speed" | 191 | int "Trade memory for gzip speed (0:small,slow - 2:fast,big)" |
192 | default n | 192 | default 0 |
193 | depends on GZIP | 193 | range 0 2 |
194 | help | 194 | depends on GZIP |
195 | Enable big memory options for gzip, including larger I/O | 195 | help |
196 | buffers and bigger hash tables. Faster, but uses at least | 196 | Enable big memory options for gzip. |
197 | twice as much memory. Select if speed is more important than | 197 | 0: small buffers, small hash-tables |
198 | memory use. | 198 | 1: larger buffers, larger hash-tables |
199 | 2: larger buffers, largest hash-tables | ||
200 | Larger models may give slightly better compression | ||
199 | 201 | ||
200 | config LZOP | 202 | config LZOP |
201 | bool "lzop" | 203 | bool "lzop" |
@@ -340,15 +342,12 @@ config UNLZMA | |||
340 | is generally considerably better than that achieved by the bzip2 | 342 | is generally considerably better than that achieved by the bzip2 |
341 | compressors. | 343 | compressors. |
342 | 344 | ||
343 | The BusyBox unlzma applet is limited to de-compression only. | 345 | The BusyBox unlzma applet is limited to decompression only. |
344 | On an x86 system, this applet adds about 4K. | 346 | On an x86 system, this applet adds about 4K. |
345 | 347 | ||
346 | Unless you have a specific application which requires unlzma, you | ||
347 | should probably say N here. | ||
348 | |||
349 | config FEATURE_LZMA_FAST | 348 | config FEATURE_LZMA_FAST |
350 | bool "Optimize unlzma for speed" | 349 | bool "Optimize unlzma for speed" |
351 | default y | 350 | default n |
352 | depends on UNLZMA | 351 | depends on UNLZMA |
353 | help | 352 | help |
354 | This option reduces decompression time by about 25% at the cost of | 353 | This option reduces decompression time by about 25% at the cost of |
diff --git a/archival/bzip2.c b/archival/bzip2.c index e39d7f704..3dde970f1 100644 --- a/archival/bzip2.c +++ b/archival/bzip2.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include "libbb.h" | 19 | #include "libbb.h" |
20 | #include "archive.h" | 20 | #include "archive.h" |
21 | 21 | ||
22 | #define CONFIG_BZIP2_FEATURE_SPEED 1 | 22 | #define CONFIG_BZIP2_FAST 1 |
23 | 23 | ||
24 | /* Speed test: | 24 | /* Speed test: |
25 | * Compiled with gcc 4.2.1, run on Athlon 64 1800 MHz (512K L2 cache). | 25 | * Compiled with gcc 4.2.1, run on Athlon 64 1800 MHz (512K L2 cache). |
@@ -27,7 +27,7 @@ | |||
27 | * (time to compress gcc-4.2.1.tar is 126.4% compared to bbox). | 27 | * (time to compress gcc-4.2.1.tar is 126.4% compared to bbox). |
28 | * At SPEED 5 difference is 32.7%. | 28 | * At SPEED 5 difference is 32.7%. |
29 | * | 29 | * |
30 | * Test run of all CONFIG_BZIP2_FEATURE_SPEED values on a 11Mb text file: | 30 | * Test run of all CONFIG_BZIP2_FAST values on a 11Mb text file: |
31 | * Size Time (3 runs) | 31 | * Size Time (3 runs) |
32 | * 0: 10828 4.145 4.146 4.148 | 32 | * 0: 10828 4.145 4.146 4.148 |
33 | * 1: 11097 3.845 3.860 3.861 | 33 | * 1: 11097 3.845 3.860 3.861 |
diff --git a/archival/gzip.c b/archival/gzip.c index 0e0b68142..3af930b7e 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -81,10 +81,14 @@ aa: 85.1% -- replaced with aa.gz | |||
81 | 81 | ||
82 | /* =========================================================================== | 82 | /* =========================================================================== |
83 | */ | 83 | */ |
84 | #if ENABLE_GZIP_BIG_MEM | 84 | #if CONFIG_GZIP_FAST == 0 |
85 | # define SMALL_MEM | ||
86 | #elif CONFIG_GZIP_FAST == 1 | ||
87 | # define MEDIUM_MEM | ||
88 | #elif CONFIG_GZIP_FAST == 2 | ||
85 | # define BIG_MEM | 89 | # define BIG_MEM |
86 | #else | 90 | #else |
87 | # define SMALL_MEM | 91 | # error "Invalid CONFIG_GZIP_FAST value" |
88 | #endif | 92 | #endif |
89 | 93 | ||
90 | #ifndef INBUFSIZ | 94 | #ifndef INBUFSIZ |
diff --git a/archival/libarchive/bz/blocksort.c b/archival/libarchive/bz/blocksort.c index f70c3701d..e600cb7a7 100644 --- a/archival/libarchive/bz/blocksort.c +++ b/archival/libarchive/bz/blocksort.c | |||
@@ -385,7 +385,7 @@ int mainGtU( | |||
385 | * but speeds up compression 10% overall | 385 | * but speeds up compression 10% overall |
386 | */ | 386 | */ |
387 | 387 | ||
388 | #if CONFIG_BZIP2_FEATURE_SPEED >= 1 | 388 | #if CONFIG_BZIP2_FAST >= 1 |
389 | 389 | ||
390 | #define TIMES_8(code) \ | 390 | #define TIMES_8(code) \ |
391 | code; code; code; code; \ | 391 | code; code; code; code; \ |
@@ -496,7 +496,7 @@ void mainSimpleSort(uint32_t* ptr, | |||
496 | i++; | 496 | i++; |
497 | 497 | ||
498 | /* 1.5% overall speedup, +290 bytes */ | 498 | /* 1.5% overall speedup, +290 bytes */ |
499 | #if CONFIG_BZIP2_FEATURE_SPEED >= 3 | 499 | #if CONFIG_BZIP2_FAST >= 3 |
500 | /*-- copy 2 --*/ | 500 | /*-- copy 2 --*/ |
501 | if (i > hi) break; | 501 | if (i > hi) break; |
502 | v = ptr[i]; | 502 | v = ptr[i]; |
@@ -750,7 +750,7 @@ void mainSort(EState* state, | |||
750 | j = block[0] << 8; | 750 | j = block[0] << 8; |
751 | i = nblock - 1; | 751 | i = nblock - 1; |
752 | /* 3%, +300 bytes */ | 752 | /* 3%, +300 bytes */ |
753 | #if CONFIG_BZIP2_FEATURE_SPEED >= 2 | 753 | #if CONFIG_BZIP2_FAST >= 2 |
754 | for (; i >= 3; i -= 4) { | 754 | for (; i >= 3; i -= 4) { |
755 | quadrant[i] = 0; | 755 | quadrant[i] = 0; |
756 | j = (j >> 8) | (((uint16_t)block[i]) << 8); | 756 | j = (j >> 8) | (((uint16_t)block[i]) << 8); |
@@ -787,7 +787,7 @@ void mainSort(EState* state, | |||
787 | 787 | ||
788 | s = block[0] << 8; | 788 | s = block[0] << 8; |
789 | i = nblock - 1; | 789 | i = nblock - 1; |
790 | #if CONFIG_BZIP2_FEATURE_SPEED >= 2 | 790 | #if CONFIG_BZIP2_FAST >= 2 |
791 | for (; i >= 3; i -= 4) { | 791 | for (; i >= 3; i -= 4) { |
792 | s = (s >> 8) | (block[i] << 8); | 792 | s = (s >> 8) | (block[i] << 8); |
793 | j = ftab[s] - 1; | 793 | j = ftab[s] - 1; |
diff --git a/archival/libarchive/bz/bzlib_private.h b/archival/libarchive/bz/bzlib_private.h index 6430ce407..43e674bec 100644 --- a/archival/libarchive/bz/bzlib_private.h +++ b/archival/libarchive/bz/bzlib_private.h | |||
@@ -183,7 +183,7 @@ typedef struct EState { | |||
183 | /* stack-saving measures: these can be local, but they are too big */ | 183 | /* stack-saving measures: these can be local, but they are too big */ |
184 | int32_t sendMTFValues__code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; | 184 | int32_t sendMTFValues__code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; |
185 | int32_t sendMTFValues__rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; | 185 | int32_t sendMTFValues__rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; |
186 | #if CONFIG_BZIP2_FEATURE_SPEED >= 5 | 186 | #if CONFIG_BZIP2_FAST >= 5 |
187 | /* second dimension: only 3 needed; 4 makes index calculations faster */ | 187 | /* second dimension: only 3 needed; 4 makes index calculations faster */ |
188 | uint32_t sendMTFValues__len_pack[BZ_MAX_ALPHA_SIZE][4]; | 188 | uint32_t sendMTFValues__len_pack[BZ_MAX_ALPHA_SIZE][4]; |
189 | #endif | 189 | #endif |
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c index f93671742..e9f1afdaf 100644 --- a/archival/libarchive/bz/compress.c +++ b/archival/libarchive/bz/compress.c | |||
@@ -61,7 +61,7 @@ void bsFinishWrite(EState* s) | |||
61 | /*---------------------------------------------------*/ | 61 | /*---------------------------------------------------*/ |
62 | static | 62 | static |
63 | /* Helps only on level 5, on other levels hurts. ? */ | 63 | /* Helps only on level 5, on other levels hurts. ? */ |
64 | #if CONFIG_BZIP2_FEATURE_SPEED >= 5 | 64 | #if CONFIG_BZIP2_FAST >= 5 |
65 | ALWAYS_INLINE | 65 | ALWAYS_INLINE |
66 | #endif | 66 | #endif |
67 | void bsW(EState* s, int32_t n, uint32_t v) | 67 | void bsW(EState* s, int32_t n, uint32_t v) |
@@ -331,7 +331,7 @@ void sendMTFValues(EState* s) | |||
331 | for (v = 0; v < alphaSize; v++) | 331 | for (v = 0; v < alphaSize; v++) |
332 | s->rfreq[t][v] = 0; | 332 | s->rfreq[t][v] = 0; |
333 | 333 | ||
334 | #if CONFIG_BZIP2_FEATURE_SPEED >= 5 | 334 | #if CONFIG_BZIP2_FAST >= 5 |
335 | /* | 335 | /* |
336 | * Set up an auxiliary length table which is used to fast-track | 336 | * Set up an auxiliary length table which is used to fast-track |
337 | * the common case (nGroups == 6). | 337 | * the common case (nGroups == 6). |
@@ -361,7 +361,7 @@ void sendMTFValues(EState* s) | |||
361 | */ | 361 | */ |
362 | for (t = 0; t < nGroups; t++) | 362 | for (t = 0; t < nGroups; t++) |
363 | cost[t] = 0; | 363 | cost[t] = 0; |
364 | #if CONFIG_BZIP2_FEATURE_SPEED >= 5 | 364 | #if CONFIG_BZIP2_FAST >= 5 |
365 | if (nGroups == 6 && 50 == ge-gs+1) { | 365 | if (nGroups == 6 && 50 == ge-gs+1) { |
366 | /*--- fast track the common case ---*/ | 366 | /*--- fast track the common case ---*/ |
367 | register uint32_t cost01, cost23, cost45; | 367 | register uint32_t cost01, cost23, cost45; |
@@ -420,7 +420,7 @@ void sendMTFValues(EState* s) | |||
420 | * Increment the symbol frequencies for the selected table. | 420 | * Increment the symbol frequencies for the selected table. |
421 | */ | 421 | */ |
422 | /* 1% faster compress. +800 bytes */ | 422 | /* 1% faster compress. +800 bytes */ |
423 | #if CONFIG_BZIP2_FEATURE_SPEED >= 4 | 423 | #if CONFIG_BZIP2_FAST >= 4 |
424 | if (nGroups == 6 && 50 == ge-gs+1) { | 424 | if (nGroups == 6 && 50 == ge-gs+1) { |
425 | /*--- fast track the common case ---*/ | 425 | /*--- fast track the common case ---*/ |
426 | #define BZ_ITUR(nn) s->rfreq[bt][mtfv[gs + (nn)]]++ | 426 | #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 676b1af66..bbec11adb 100644 --- a/archival/libarchive/bz/huffman.c +++ b/archival/libarchive/bz/huffman.c | |||
@@ -48,7 +48,7 @@ in the file LICENSE. | |||
48 | 48 | ||
49 | 49 | ||
50 | /* 90 bytes, 0.3% of overall compress speed */ | 50 | /* 90 bytes, 0.3% of overall compress speed */ |
51 | #if CONFIG_BZIP2_FEATURE_SPEED >= 1 | 51 | #if CONFIG_BZIP2_FAST >= 1 |
52 | 52 | ||
53 | /* macro works better than inline (gcc 4.2.1) */ | 53 | /* macro works better than inline (gcc 4.2.1) */ |
54 | #define DOWNHEAP1(heap, weight, Heap) \ | 54 | #define DOWNHEAP1(heap, weight, Heap) \ |