diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-09 17:58:09 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-09 17:58:09 +0000 |
commit | 6a1a10aa54e5f9abe0b8d68e9550a706d0f30353 (patch) | |
tree | dbd4754fedda7a3c87926bc390ca426198e2fe73 /llvm/lib/Support/Compressor.cpp | |
parent | 436285e75d400ebfae02bb40ab2f88d26d80304c (diff) | |
download | bcm5719-llvm-6a1a10aa54e5f9abe0b8d68e9550a706d0f30353.tar.gz bcm5719-llvm-6a1a10aa54e5f9abe0b8d68e9550a706d0f30353.zip |
Tune compression:
bzip2: block size 9 -> 5, reduces memory by 400Kbytes, doesn't affect speed
or compression ratio on all but the largest bytecode files (>1MB)
zip: level 9 -> 6, this speeds up compression time by ~30% but only
degrades the compressed size by a few bytes per megabyte. Those few
bytes aren't worth the effort.
llvm-svn: 17647
Diffstat (limited to 'llvm/lib/Support/Compressor.cpp')
-rw-r--r-- | llvm/lib/Support/Compressor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Compressor.cpp b/llvm/lib/Support/Compressor.cpp index 0a7253f7903..6a1fdb9b97d 100644 --- a/llvm/lib/Support/Compressor.cpp +++ b/llvm/lib/Support/Compressor.cpp @@ -136,7 +136,7 @@ uint64_t Compressor::compress(char* in, unsigned size, OutputDataCallback* cb, bzdata.avail_in = size; bzdata.next_out = 0; bzdata.avail_out = 0; - switch ( BZ2_bzCompressInit(&bzdata, 9, 0, 100) ) { + switch ( BZ2_bzCompressInit(&bzdata, 5, 0, 100) ) { case BZ_CONFIG_ERROR: throw std::string("bzip2 library mis-compiled"); case BZ_PARAM_ERROR: throw std::string("Compressor internal error"); case BZ_MEM_ERROR: throw std::string("Out of memory"); @@ -190,7 +190,7 @@ uint64_t Compressor::compress(char* in, unsigned size, OutputDataCallback* cb, zdata.opaque = Z_NULL; zdata.next_in = reinterpret_cast<Bytef*>(in); zdata.avail_in = size; - if (Z_OK != deflateInit(&zdata,Z_BEST_COMPRESSION)) + if (Z_OK != deflateInit(&zdata,6)) throw std::string(zdata.msg ? zdata.msg : "zlib error"); if (0 != getdata((char*&)(zdata.next_out), zdata.avail_out,cb,context)) { |