mirror of
https://github.com/eledio-devices/thirdparty-miniz.git
synced 2025-10-30 16:15:41 +01:00
Migrating wiki contents from Google Code
This commit is contained in:
146
ProjectHome.md
Normal file
146
ProjectHome.md
Normal file
@@ -0,0 +1,146 @@
|
||||
[miniz.c](http://code.google.com/p/miniz/source/browse/trunk/miniz.c) is a lossless, high performance data compression library in a single source file that implements the [zlib](http://en.wikipedia.org/wiki/Zlib) ([RFC 1950](http://www.ietf.org/rfc/rfc1950.txt)) and [Deflate](http://en.wikipedia.org/wiki/Deflate) ([RFC 1951](http://www.ietf.org/rfc/rfc1951.txt)) compressed data format specification standards. It supports the most commonly used functions exported by the [zlib library](http://www.zlib.net/), but is a completely independent implementation so zlib's licensing requirements do not apply. miniz.c also contains simple to use functions for writing [.PNG format](http://en.wikipedia.org/wiki/Portable_Network_Graphics) image files and reading/writing/appending [.ZIP format](http://en.wikipedia.org/wiki/ZIP_(file_format)) archives. miniz's compression speed has been tuned to be comparable to zlib's, and it also has a specialized real-time compressor function designed to compare well against fastlz/minilzo.
|
||||
|
||||
Here's a [blog update](http://richg42.blogspot.com/2013/10/minizc-finally-added-zip64-support.html) on miniz bug fixes/enhancements, and the current status of zip64 support. The source to the zip64 variant of miniz was released as part of Valve's vogl codebase:
|
||||
http://richg42.blogspot.com/2014/03/zip64-version-of-miniz-library-released.html
|
||||
|
||||
Whenever I get the chance I'll be extracting it and releasing it separately.
|
||||
|
||||
### Features ###
|
||||
* Completely free: Public domain in jurisdictions that recognize copyright laws, with a license patterned after the public domain SQLite project, see [unlicense.org](http://unlicense.org/).
|
||||
* A portable, single source file header file library written in plain C. I've tested with clang v3.3, various versions of gcc, mingw, MSVC 2008/2010, and TCC (Tiny C Compiler) v0.9.26, under both Linux and Windows x86/x64. Earlier versions of miniz where also tested on OSX, and miniz.c has shipped in several iOS games.
|
||||
* Easily tuned and trimmed down by configuring macros at the top of the source file.
|
||||
* A drop-in replacement for zlib's most used API's (tested in several open source projects that use zlib, such as libpng and libzip).
|
||||
* Fills a single threaded performance vs. compression ratio gap between several popular real-time compressors and zlib. For example, at level 1, miniz.c compresses around 5-9% better than [minilzo](http://oldhome.schmorp.de/marc/liblzf.html), but is approx. 35% slower. At levels 2-9, miniz.c is designed to compare favorably against zlib's ratio and speed. See the [miniz performance comparison](http://code.google.com/p/miniz/wiki/miniz_performance_comparison_v110) page for example timings.
|
||||
* Not a block based compressor: miniz.c fully supports stream based processing using a coroutine-style implementation. The zlib-style API functions can be called a single byte at a time if that's all you've got.
|
||||
* Easy to use. The low-level compressor (tinfl) and decompressor (tdefl) have simple state structs which can be saved/restored as needed with simple memcpy's. The low-level codec API's don't use the heap in any way.
|
||||
* Entire inflater (including optional zlib header parsing and Adler-32 checking) is implemented in a single function as a coroutine, which is separately available in a small (~550 line) source file: [tinfl.c](http://code.google.com/p/miniz/source/browse/trunk/tinfl.c)
|
||||
* A fairly complete (but totally optional) set of .ZIP archive manipulation and extraction API's. The archive functionality is intended to solve common problems encountered in embedded, mobile, or game development situations. (The archive API's are purposely just powerful enough to write an entire archiver given a bit of additional higher-level logic.)
|
||||
|
||||
I've created a [wiki page](http://code.google.com/p/miniz/wiki/miniz_performance_comparison_v110) comparing the speed and compression ratio of miniz.c verses various other open source codecs. miniz.c's compression ratio is very close to zlib's (sometimes better, or sometimes a small amount worse because it tends to output more blocks due to using less memory), and is typically (but not always) faster, even without any platform specific assembly language optimizations.
|
||||
|
||||
### Release History ###
|
||||
* v1.16 BETA - Oct 19, 2013: Still testing, this release is downloadable from [here](http://www.tenacioussoftware.com/miniz_v116_beta_r1.7z). Two key inflator-only robustness and streaming related changes. Also merged in tdefl\_compressor\_alloc(), tdefl\_compressor\_free() helpers to make script bindings easier for rustyzip. I would greatly appreciate any help with testing or any feedback.
|
||||
|
||||
> The inflator in raw (non-zlib) mode is now usable on gzip or similar streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520). This version should **never** read beyond the last byte of the raw deflate data independent of how many bytes you pass into the input buffer.
|
||||
|
||||
> The inflator now has a new failure status TINFL\_STATUS\_FAILED\_CANNOT\_MAKE\_PROGRESS (-4). Previously, if the inflator was starved of bytes and could not make progress (because the input buffer was empty and the caller did not set the TINFL\_FLAG\_HAS\_MORE\_INPUT flag - say on truncated or corrupted compressed data stream) it would append all 0's to the input and try to soldier on. This is scary behavior if the caller didn't know when to stop accepting output (because it didn't know how much uncompressed data was expected, or didn't enforce a sane maximum). v1.16 will instead return TINFL\_STATUS\_FAILED\_CANNOT\_MAKE\_PROGRESS immediately if it needs 1 or more bytes to make progress, the input buf is empty, and the caller has indicated that no more input is available. This is a "soft" failure, so you can call the inflator again with more input and it will try to continue, or you can give up and fail. This could be very useful in network streaming scenarios.
|
||||
|
||||
> The other minor changes are documented at the top of miniz.c.
|
||||
|
||||
* v1.15 `r4` STABLE - Oct 13, 2013: Merged over a few very minor bug fixes that I fixed in the zip64 branch. This is downloadable from [here](http://code.google.com/p/miniz/downloads/list) and also in SVN head (as of 10/19/13).
|
||||
* v1.15 - Oct. 13, 2013: Interim bugfix release while I work on the next major release with zip64 and streaming compression/decompression support. Fixed the MZ\_ZIP\_FLAG\_DO\_NOT\_SORT\_CENTRAL\_DIRECTORY bug (thanks kahmyong.moon@hp.com), which could cause the locate files func to not find files when this flag was specified. Also fixed a bug in mz\_zip\_reader\_extract\_to\_mem\_no\_alloc() with user provided read buffers (thanks kymoon). I also merged lots of compiler fixes from various github repo branches and Google Code issue reports. I finally added cmake support (only tested under for Linux so far), compiled and tested with clang v3.3 and gcc 4.6 (under Linux), added defl\_write\_image\_to\_png\_file\_in\_memory\_ex() (supports Y flipping for OpenGL use, real-time compression), added a new PNG example (example6.c - Mandelbrot), and I added 64-bit file I/O support (stat64(), etc.) for glibc.
|
||||
* v1.14 - May 20, 2012: (SVN Only) Minor tweaks to get miniz.c compiling with the [Tiny C Compiler](http://bellard.org/tcc), added `#ifndef MINIZ_NO_TIME` guards around `utime.h` includes. Adding `mz_free()` function, so the caller can free heap blocks returned by miniz using whatever heap functions it has been configured to use, MSVC specific fixes to use "safe" variants of several functions (localtime\_s, fopen\_s, freopen\_s).
|
||||
* v1.14 - May 20, 2012: Compiler specific fixes, some from fermtect. I upgraded to TDM GCC 4.6.1 and now `static __forceinline` is giving it fits, so I'm changing all usage of `__forceinline` to MZ\_FORCEINLINE and forcing gcc to use `__attribute__((__always_inline__))` (and MSVC to use `__forceinline`). Also various fixes from fermtect for MinGW32: added #include <time.h>, 64-bit ftell/fseek fixes.
|
||||
* v1.13 - May 19, 2012: From jason@cornsyrup.org and kelwert@mtu.edu - Most importantly, fixed mz\_crc32() so it doesn't compute the wrong CRC-32's when mz\_ulong is 64-bits. Temporarily/locally slammed in "typedef unsigned long mz\_ulong" and re-ran a randomized regression test on ~500k files. Other stuff:
|
||||
|
||||
> Eliminated a bunch of warnings when compiling with GCC 32-bit/64. Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly "Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning).
|
||||
|
||||
> Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. Added miniz\_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test. Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ\_NO\_STDIO, etc.). (Thanks to corysama for the MINIZ\_NO\_STDIO bug report.)
|
||||
|
||||
> Fix ftell() usage in a few of the examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself). Fix fail logic handling in mz\_zip\_add\_mem\_to\_archive\_file\_in\_place() so it always calls mz\_zip\_writer\_finalize\_archive() and mz\_zip\_writer\_end(), even if the file add fails.
|
||||
|
||||
### Details ###
|
||||
|
||||
miniz.c employs several proven techniques and approaches used in my much more powerful (but slower and more complex) lossless [lzham](http://code.google.com/p/lzham/) codec, and in my [jpeg-compressor](http://code.google.com/p/jpeg-compressor/) project. Specifically, miniz.c's linear-time Huffman codelength generator, the single switch-statement approach used to implement the decompressor as a single function [coroutine](http://en.wikipedia.org/wiki/Coroutine), and its very fast [Huffman](http://en.wikipedia.org/wiki/Huffman_coding) code symbol unpacker are all loosely based off the implementations I wrote for these earlier projects.
|
||||
|
||||
miniz.c v1.10 includes an optimized real-time compressor written specifically for compression level 1 (MZ\_BEST\_SPEED). miniz.c's level 1 compression ratio is around 5-9% higher than other real-time compressors, such as [minilzo](http://www.oberhumer.com/opensource/lzo/), [fastlz](http://www.fastlz.org/), or [liblzf](http://oldhome.schmorp.de/marc/liblzf.html). miniz.c's level 1 data consumption rate on a Core i7 3.2 GHz typically ranges between 70-120.5 MB/sec. Between levels 2-9, miniz.c is designed to compare favorably against zlib, where it typically has roughly equal or better performance.
|
||||
|
||||
miniz.c has been compiled and tested under Windows (x86 and x64, using MSVC 2005/2008 and GCC 4.5.0 using TDM-GCC x64), and under 32-bit Ubuntu Linux (Lucid Lynx using gcc). The code should be endian safe, but I have not tested it on a big endian platform yet. For maximum compatibility, unused or unnecessary features of miniz.c can be completely disabled via #define's - see the code for details.
|
||||
|
||||
miniz's PNG writer has been verified using the [pngcheck](http://www.libpng.org/pub/png/apps/pngcheck.html) tool.
|
||||
|
||||
If you use miniz, I would greatly appreciate it if you sent me an email with any feedback, or info on how you're using it in practice.
|
||||
|
||||
### Implemented zlib Functions ###
|
||||
|
||||
miniz.c implements the following standard zlib functions:
|
||||
|
||||
* Compression: `deflateInit`, `deflateInit2`, `deflateReset`, `deflate`, `deflateEnd`, `deflateBound`
|
||||
* Single call compression: `compress`, `compress2`, `compressBound`
|
||||
* Decompression: `inflateInit`, `inflateInit2`, `inflate`, `inflateEnd`
|
||||
* Single call decompression: `uncompress`
|
||||
* Allocation callbacks: `alloc_func`, `free_func`
|
||||
* Stream structure: `z_stream`
|
||||
* Misc. functions: `crc32`, `adler32`, `zError`, `zlib_version`
|
||||
|
||||
Note, miniz.c actually prefixes its zlib-like functions and macros with the `mz_` or `MZ_` prefixes, and it uses a set of macros to redefine the zlib symbols to miniz's internal symbols. These optional remapping macros can be disabled by defining the `MINIZ_NO_ZLIB_COMPATIBLE_NAMES` macro, allowing miniz.c to be mixed with zlib in the same compilation unit.
|
||||
|
||||
### Simple Examples ###
|
||||
|
||||
Include [miniz.c](http://code.google.com/p/miniz/source/browse/trunk/miniz.c) and call one of these (zlib-style) helper functions for:
|
||||
|
||||
Memory to Memory Compression
|
||||
|
||||
```
|
||||
// Returns Z_OK on success, or one of the error codes from deflate() on failure.
|
||||
int compress(Byte *pDest, uLong *pDest_len, const Byte *pSource, uLong source_len);
|
||||
|
||||
// Like compress() but with more control, level may range from 0 (storing) to 9 (max. compression)
|
||||
int compress2(Byte *pDest, uLong *pDest_len, const Byte *pSource, uLong source_len, int level);
|
||||
```
|
||||
|
||||
Memory to Memory Decompression
|
||||
```
|
||||
// Returns Z_OK on success, or one of the error codes from inflate() on failure.
|
||||
int uncompress(Byte *pDest, uLong *pDest_len, const Byte *pSource, uLong source_len);
|
||||
```
|
||||
|
||||
Extract a single file from a ZIP archive:
|
||||
```
|
||||
// Returns pointer to extracted file, or NULL on failure.
|
||||
void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name,
|
||||
size_t *pSize, mz_uint zip_flags);
|
||||
```
|
||||
|
||||
Add a single file to an existing ZIP archive, or create a new archive, with optional file comment:
|
||||
```
|
||||
mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name,
|
||||
const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
|
||||
```
|
||||
|
||||
Write a .PNG format image to a file in memory:
|
||||
```
|
||||
void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out);
|
||||
```
|
||||
|
||||
These are just basic examples. For more control, miniz.c has many helper functions to compress zlib and raw deflate streams to/from files, memory, the heap, or user supplied callbacks. For maximum control, miniz.c also includes a set of low-level "tinfl" (decompression) and "tdefl" (compression) coroutine functions that read and write to user supplied buffers and do not use the heap in any way -- see the top of the file for more details. (Internally, all high level compression related functions are implemented in terms of tinfl and tdefl.)
|
||||
|
||||
### Known Problems ###
|
||||
* No support for encrypted or zip64 archives. I'm not sure how useful this stuff is in practice. Zip encryption is very weak, and it's unclear how many people are interested in reading/writing huge archives with a small library like this. Please email if you're interested in these features. Oct. 13, 2013: OK, I've implemented zip64 which I needed for a project at work. It's **a lot** of new code, so much that I'm going to split up miniz.c into two files (miniz.c for the codec bits, and miniz\_zip.c for archive handling). I'm not going to release it until I get to bang on it more, but email me if you would like to take a peek.
|
||||
* Minimal documentation. I'm assuming the user is already familiar with the basic zlib API. I need to write an API wiki - for now I've tried to place key comments before each enum/API, and I've included 6 examples that demonstrate how to use the module's major features.
|
||||
|
||||
## Special Thanks ##
|
||||
Thanks to Alex Evans for the PNG writer function. Also, thanks to Paul Holden and Thorsten Scheuermann for feedback and testing, Matt Pritchard for all his encouragement, and [Sean Barrett](http://nothings.org/)'s various public domain libraries for inspiration (and encouraging me to write miniz.c in C, which was much more enjoyable and less painful than I thought it would be considering I've been programming in C++ for so long).
|
||||
|
||||
Thanks to Bruce Dawson <bruced@valvesoftware.com> for reporting a problem with the level\_and\_flags archive API parameter (which is fixed in v1.12) and general feedback, and Janez Zemva <janezz55@gmail.com> for indirectly encouraging me into writing more examples.
|
||||
|
||||
## Patents ##
|
||||
I was recently asked if miniz avoids patent issues. miniz purposely uses the same core algorithms as the ones used by zlib. The compressor uses vanilla hash chaining as described [here](http://www.gzip.org/zlib/rfc-deflate.html#algorithm). Also see the [gzip FAQ](http://www.gzip.org/#faq11). In my opinion, if miniz falls prey to a patent attack then zlib/gzip are likely to be at serious risk too.
|
||||
|
||||
### Building the Examples Under Linux ###
|
||||
|
||||
v1.15 includes a CMakeLists.txt file to use with cmake:
|
||||
|
||||
```
|
||||
cmake .
|
||||
make clean
|
||||
make
|
||||
```
|
||||
|
||||
This will build the x64 release examples by default on x64 systems. Optionally, you can use ccmake (package cmake-curses-gui) to configure the project after running cmake ("ccmake ."). I've built and tested v1.15 with tcc 0.9.26 (Tiny C Compiler), clang v3.3, and gcc 4.6.3.
|
||||
|
||||
### Example Projects ###
|
||||
I've included a Visual Studio 2008 solution (examples.sln) with 6 examples:
|
||||
* [example1.c](http://code.google.com/p/miniz/source/browse/trunk/example1.c): Demonstrates miniz.c's compress() and uncompress() functions (same as zlib's), also a crude decompressor fuzzy test.
|
||||
* [example2.c](http://code.google.com/p/miniz/source/browse/trunk/example2.c): Demonstration of miniz.c's ZIP archive API's. Adds a bunch of files to test.zip, dumps file stat info on each file in the archive, then extracts a single file into memory.
|
||||
* [example3.c](http://code.google.com/p/miniz/source/browse/trunk/example3.c): Command line tool for file compression/decompression. Demonstrates how to use miniz.c's deflate() and inflate() functions to handle streaming compression/decompression.
|
||||
* [example4.c](http://code.google.com/p/miniz/source/browse/trunk/example4.c): Demonstrates memory to callback decompression of compressed zlib streams (can decompress files generated by example3). Simple demo of [tinfl.c](http://code.google.com/p/miniz/source/browse/trunk/tinfl.c), which is just the Inflate functionality pulled from the larger miniz.c. tinfl.c is a full single-function Inflate implementation with zlib header parsing and Adler32 checking in ~550 lines of code+comments.
|
||||
* [example5.c](http://code.google.com/p/miniz/source/browse/trunk/example5.c): Demonstrates how to use the lowest level (non-zlib compatible) API's for file to file compression. The low-level API's are less forgiving, but more flexible, faster, and don't ever touch the heap. The low-level API's are implemented as coroutines, so they can be efficiently used for any sort of streaming scenario.
|
||||
* [example6.c](http://code.google.com/p/miniz/source/browse/trunk/example6.c): Simple PNG writing demonstration.
|
||||
* As of v1.13 I also include one of the test app (miniz\_tester.cpp) I used to regression test miniz. This command line tool is only intended for testing, and it wasn't intended to be an example, but I'm releasing it in case someone finds it useful.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
For any questions or problems with this code please contact Rich Geldreich at <richgel99 at gmail.com>. Here's my [twitter page](http://twitter.com/#!/richgel999).
|
||||
238
miniz_performance_comparison.md
Normal file
238
miniz_performance_comparison.md
Normal file
@@ -0,0 +1,238 @@
|
||||
# Introduction #
|
||||
|
||||
This page shows how miniz.c v1.09 compares to several other popular open source data compression codecs at compression level 9 (max compression), with one example at level 1 (fastest compression) on wik8. The data here was generated using a slightly modified and enhanced version of [John Ratcliff's](http://en.wikipedia.org/wiki/John_W._Ratcliff) [compressiontest](http://code.google.com/p/compressiontest/) project, compiled to x64.
|
||||
|
||||
miniz.c's typical decompression rate is around 175-250 MB/sec. on a Core i7, and its typical compression rate is anywhere from 7-48.5MB/s (actual rates depend on the compression level, as well as the compressibility and redundancy present in the source data). The x64 version of the decompressor is faster than the x86 version, sometimes up to 20%, mostly due to good register utilization. miniz.c's inflater can be optionally configured to use a 64-bit bitbuffer on 64-bit CPU's, and unaligned 16 and 32-bit loads on little endian platforms (the tests below had both optimizations enabled).
|
||||
|
||||
For comparison purposes, I've added [stb\_image.c](http://nothings.org/stb_image.c)'s Inflater implementation to compresssiontest, and [LZHAM](http://code.google.com/p/lzham/) alpha7. Note that miniz.c is used for compressing the data supplied to stb\_image.c for decompression (stb\_image.c does not include a compressor, [stb\_image\_write.h](http://nothings.org/stb/stb_image_write.h) contains a simple compressor but I haven't tested it yet). Also, stb\_image.c does not compute an [Adler-32](http://en.wikipedia.org/wiki/Adler32) checksum of the uncompressed data, and miniz.c and zlib do, so stb's actual "apples to apples" performance is a little lower than reported here. (Approximately 10% of miniz.c's decompression time is spent computing the Adler32 checksum. Note, stb\_image.c is extremely useful and it inspired miniz.c -- I'm only using it as a point of reference to help compare alternate Inflate implementations against zlib.)
|
||||
|
||||
Test machine: Win7 Ultimate x64, Intel Gulftown Core i7 3.2GHz (6 cores, 12 hyperthreads), 24GB of RAM, EVGA X58 motherboard. All code was compiled with Visual Studio 2005.
|
||||
|
||||
**File: [enwik8](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64 e:\dev\corpus\enwik8\enwik8
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\enwik8\enwik8' which is 100,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:100,000,000 TO: 36,473,214 63.53% 6,398 MS
|
||||
Compress:CT_MINIZ :FROM:100,000,000 TO: 36,473,214 63.53% 6,394 MS
|
||||
Compress:CT_CRYPTO :FROM:100,000,000 TO: 36,642,772 63.36% 7,519 MS
|
||||
Compress:CT_MINILZO :FROM:100,000,000 TO: 53,481,960 46.52% 870 MS
|
||||
Compress:CT_ZLIB :FROM:100,000,000 TO: 36,475,808 63.52% 7,620 MS
|
||||
Compress:CT_BZIP :FROM:100,000,000 TO: 33,259,584 66.74% 9,406 MS
|
||||
Compress:CT_LIBLZF :FROM:100,000,000 TO: 53,945,398 46.05% 688 MS
|
||||
Compress:CT_LZMA :FROM:100,000,000 TO: 25,209,489 74.79% 79,688 MS
|
||||
Compress:CT_FASTLZ :FROM:100,000,000 TO: 54,163,029 45.84% 738 MS
|
||||
Compress:CT_LZHAM :FROM:100,000,000 TO: 25,248,714 74.75% 26,848 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 36,473,214 TO:100,000,000 728 MS
|
||||
Decompress:CT_MINIZ :FROM: 36,473,214 TO:100,000,000 558 MS
|
||||
Decompress:CT_CRYPTO :FROM: 36,642,772 TO:100,000,000 1,819 MS
|
||||
Decompress:CT_MINILZO :FROM: 53,481,960 TO:100,000,000 467 MS
|
||||
Decompress:CT_ZLIB :FROM: 36,475,808 TO:100,000,000 571 MS
|
||||
Decompress:CT_BZIP :FROM: 33,259,584 TO:100,000,000 3,617 MS
|
||||
Decompress:CT_LIBLZF :FROM: 53,945,398 TO:100,000,000 428 MS
|
||||
Decompress:CT_LZMA :FROM: 25,209,489 TO:100,000,000 1,505 MS
|
||||
Decompress:CT_FASTLZ :FROM: 54,163,029 TO:100,000,000 455 MS
|
||||
Decompress:CT_LZHAM :FROM: 25,248,714 TO:100,000,000 853 MS
|
||||
```
|
||||
|
||||
**File: [enwik8](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 1), compares miniz and stb\_image.c only (all other results are the same as above):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe e:\dev\corpus\enwik8\enwik8
|
||||
x64 version - miniz level 1 (fastest)
|
||||
Reading test file 'e:\dev\corpus\enwik8\enwik8' which is 100,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:100,000,000 TO: 40,669,733 59.33% 2,061 MS
|
||||
Compress:CT_MINIZ :FROM:100,000,000 TO: 40,669,733 59.33% 2,061 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 40,669,733 TO:100,000,000 810 MS
|
||||
Decompress:CT_MINIZ :FROM: 40,669,733 TO:100,000,000 616 MS
|
||||
```
|
||||
|
||||
**File: [enwik9](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64 e:\dev\corpus\enwik9\enwik9
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\enwik9\enwik9' which is 1,000,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:1,000,000,000 TO:322,952,682 67.70% 55,295 MS
|
||||
Compress:CT_MINIZ :FROM:1,000,000,000 TO:322,952,682 67.70% 55,259 MS
|
||||
Compress:CT_CRYPTO :FROM:1,000,000,000 TO:324,897,277 67.51% 65,783 MS
|
||||
Compress:CT_MINILZO :FROM:1,000,000,000 TO:477,237,740 52.28% 7,762 MS
|
||||
Compress:CT_ZLIB :FROM:1,000,000,000 TO:322,789,246 67.72% 66,350 MS
|
||||
Compress:CT_BZIP :FROM:1,000,000,000 TO:295,663,950 70.43% 93,238 MS
|
||||
Compress:CT_LIBLZF :FROM:1,000,000,000 TO:492,987,206 50.70% 6,306 MS
|
||||
Compress:CT_LZMA :FROM:1,000,000,000 TO:218,545,630 78.15% 748,686 MS
|
||||
Compress:CT_FASTLZ :FROM:1,000,000,000 TO:487,260,768 51.27% 6,740 MS
|
||||
Compress:CT_LZHAM :FROM:1,000,000,000 TO:219,044,419 78.10% 268,488 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM:322,952,682 TO:1,000,000,000 6,704 MS
|
||||
Decompress:CT_MINIZ :FROM:322,952,682 TO:1,000,000,000 5,055 MS
|
||||
Decompress:CT_CRYPTO :FROM:324,897,277 TO:1,000,000,000 16,761 MS
|
||||
Decompress:CT_MINILZO :FROM:477,237,740 TO:1,000,000,000 4,252 MS
|
||||
Decompress:CT_ZLIB :FROM:322,789,246 TO:1,000,000,000 5,180 MS
|
||||
Decompress:CT_BZIP :FROM:295,663,950 TO:1,000,000,000 33,624 MS
|
||||
Decompress:CT_LIBLZF :FROM:492,987,206 TO:1,000,000,000 4,019 MS
|
||||
Decompress:CT_LZMA :FROM:218,545,630 TO:1,000,000,000 13,300 MS
|
||||
Decompress:CT_FASTLZ :FROM:487,260,768 TO:1,000,000,000 4,208 MS
|
||||
Decompress:CT_LZHAM :FROM:219,044,419 TO:1,000,000,000 7,472 MS
|
||||
```
|
||||
|
||||
**File: Entire Large [Calgary Corpus](http://www.data-compression.info/Corpora/CalgaryCorpus/) added to a single uncompressed 7zip archive (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64 e:\dev\corpus\calgary_corpus.7z
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\calgary_corpus.7z' which is 3,251,898 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM: 3,251,898 TO: 1,065,056 67.25% 317 MS
|
||||
Compress:CT_MINIZ :FROM: 3,251,898 TO: 1,065,056 67.25% 317 MS
|
||||
Compress:CT_CRYPTO :FROM: 3,251,898 TO: 1,067,241 67.18% 240 MS
|
||||
Compress:CT_MINILZO :FROM: 3,251,898 TO: 1,581,684 51.36% 25 MS
|
||||
Compress:CT_ZLIB :FROM: 3,251,898 TO: 1,059,243 67.43% 351 MS
|
||||
Compress:CT_BZIP :FROM: 3,251,898 TO: 961,353 70.44% 273 MS
|
||||
Compress:CT_LIBLZF :FROM: 3,251,898 TO: 1,593,245 51.01% 20 MS
|
||||
Compress:CT_LZMA :FROM: 3,251,898 TO: 853,241 73.76% 1,267 MS
|
||||
Compress:CT_FASTLZ :FROM: 3,251,898 TO: 1,606,374 50.60% 22 MS
|
||||
Compress:CT_LZHAM :FROM: 3,251,898 TO: 891,866 72.57% 998 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 1,065,056 TO: 3,251,898 22 MS
|
||||
Decompress:CT_MINIZ :FROM: 1,065,056 TO: 3,251,898 16 MS
|
||||
Decompress:CT_CRYPTO :FROM: 1,067,241 TO: 3,251,898 54 MS
|
||||
Decompress:CT_MINILZO :FROM: 1,581,684 TO: 3,251,898 13 MS
|
||||
Decompress:CT_ZLIB :FROM: 1,059,243 TO: 3,251,898 17 MS
|
||||
Decompress:CT_BZIP :FROM: 961,353 TO: 3,251,898 104 MS
|
||||
Decompress:CT_LIBLZF :FROM: 1,593,245 TO: 3,251,898 12 MS
|
||||
Decompress:CT_LZMA :FROM: 853,241 TO: 3,251,898 54 MS
|
||||
Decompress:CT_FASTLZ :FROM: 1,606,374 TO: 3,251,898 13 MS
|
||||
Decompress:CT_LZHAM :FROM: 891,866 TO: 3,251,898 38 MS
|
||||
```
|
||||
|
||||
**File: "pic" from the Large [Calgary Corpus](http://www.data-compression.info/Corpora/CalgaryCorpus/) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64 e:\dev\corpus\large_calgary_corpus\pic
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\large_calgary_corpus\pic' which is 513,216 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM: 513,216 TO: 53,267 89.62% 65 MS
|
||||
Compress:CT_MINIZ :FROM: 513,216 TO: 53,267 89.62% 65 MS
|
||||
Compress:CT_CRYPTO :FROM: 513,216 TO: 57,166 88.86% 19 MS
|
||||
Compress:CT_MINILZO :FROM: 513,216 TO: 86,304 83.18% 2 MS
|
||||
Compress:CT_ZLIB :FROM: 513,216 TO: 52,237 89.82% 97 MS
|
||||
Compress:CT_BZIP :FROM: 513,216 TO: 49,928 90.27% 16 MS
|
||||
Compress:CT_LIBLZF :FROM: 513,216 TO: 80,772 84.26% 1 MS
|
||||
Compress:CT_LZMA :FROM: 513,216 TO: 41,897 91.84% 163 MS
|
||||
Compress:CT_FASTLZ :FROM: 513,216 TO: 81,960 84.03% 1 MS
|
||||
Compress:CT_LZHAM :FROM: 513,216 TO: 47,438 90.76% 506 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 53,267 TO: 513,216 2 MS
|
||||
Decompress:CT_MINIZ :FROM: 53,267 TO: 513,216 1 MS
|
||||
Decompress:CT_CRYPTO :FROM: 57,166 TO: 513,216 5 MS
|
||||
Decompress:CT_MINILZO :FROM: 86,304 TO: 513,216 1 MS
|
||||
Decompress:CT_ZLIB :FROM: 52,237 TO: 513,216 2 MS
|
||||
Decompress:CT_BZIP :FROM: 49,928 TO: 513,216 6 MS
|
||||
Decompress:CT_LIBLZF :FROM: 80,772 TO: 513,216 1 MS
|
||||
Decompress:CT_LZMA :FROM: 41,897 TO: 513,216 4 MS
|
||||
Decompress:CT_FASTLZ :FROM: 81,960 TO: 513,216 1 MS
|
||||
Decompress:CT_LZHAM :FROM: 47,438 TO: 513,216 7 MS
|
||||
```
|
||||
|
||||
**Files: Uncompressed 7zip archive of an Adobe Acrobat Reader 9.0 installation (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64 e:\dev\corpus\adobe.7z
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\adobe.7z' which is 146,332,683 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:146,332,683 TO: 89,209,529 39.04% 12,681 MS
|
||||
Compress:CT_MINIZ :FROM:146,332,683 TO: 89,209,529 39.04% 12,681 MS
|
||||
Compress:CT_CRYPTO :FROM:146,332,683 TO: 91,494,418 37.48% 7,077 MS
|
||||
Compress:CT_MINILZO :FROM:146,332,683 TO:101,687,569 30.51% 1,711 MS
|
||||
Compress:CT_ZLIB :FROM:146,332,683 TO: 89,166,466 39.07% 13,033 MS
|
||||
Compress:CT_BZIP :FROM:146,332,683 TO: 89,072,636 39.13% 18,490 MS
|
||||
Compress:CT_LIBLZF :FROM:146,332,683 TO:106,352,717 27.32% 1,070 MS
|
||||
Compress:CT_LZMA :FROM:146,332,683 TO: 76,305,505 47.85% 55,814 MS
|
||||
Compress:CT_FASTLZ :FROM:146,332,683 TO:105,548,437 27.87% 1,032 MS
|
||||
Compress:CT_LZHAM :FROM:146,332,683 TO: 77,260,885 47.20% 37,946 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 89,209,529 TO:146,332,683 1,114 MS
|
||||
Decompress:CT_MINIZ :FROM: 89,209,529 TO:146,332,683 771 MS
|
||||
Decompress:CT_CRYPTO :FROM: 91,494,418 TO:146,332,683 2,133 MS
|
||||
Decompress:CT_MINILZO :FROM:101,687,569 TO:146,332,683 544 MS
|
||||
Decompress:CT_ZLIB :FROM: 89,166,466 TO:146,332,683 816 MS
|
||||
Decompress:CT_BZIP :FROM: 89,072,636 TO:146,332,683 7,108 MS
|
||||
Decompress:CT_LIBLZF :FROM:106,352,717 TO:146,332,683 562 MS
|
||||
Decompress:CT_LZMA :FROM: 76,305,505 TO:146,332,683 5,383 MS
|
||||
Decompress:CT_FASTLZ :FROM:105,548,437 TO:146,332,683 556 MS
|
||||
Decompress:CT_LZHAM :FROM: 77,260,885 TO:146,332,683 1,734 MS
|
||||
```
|
||||
|
||||
**File: miniz3\_v109.zip (a test of how well various codecs handle already compressed data) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64 e:\dev\miniz3_v109.zip
|
||||
x64 version
|
||||
Reading test file 'e:\dev\miniz3_v109.zip' which is 417,549 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM: 417,549 TO: 416,325 0.29% 149 MS
|
||||
Compress:CT_MINIZ :FROM: 417,549 TO: 416,325 0.29% 149 MS
|
||||
Compress:CT_CRYPTO :FROM: 417,549 TO: 417,658 -0.03% 9 MS
|
||||
Compress:CT_MINILZO :FROM: 417,549 TO: 417,760 -0.05% 7 MS
|
||||
Compress:CT_ZLIB :FROM: 417,549 TO: 416,408 0.27% 18 MS
|
||||
Compress:CT_BZIP :FROM: 417,549 TO: 420,125 -0.62% 72 MS
|
||||
Compress:CT_LIBLZF :FROM: 417,549 TO: 429,060 -2.76% 4 MS
|
||||
Compress:CT_LZMA :FROM: 417,549 TO: 420,196 -0.63% 107 MS
|
||||
Compress:CT_FASTLZ :FROM: 417,549 TO: 429,044 -2.75% 3 MS
|
||||
Compress:CT_LZHAM :FROM: 417,549 TO: 417,575 -0.01% 77 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 416,325 TO: 417,549 1 MS
|
||||
Decompress:CT_MINIZ :FROM: 416,325 TO: 417,549 2 MS
|
||||
Decompress:CT_CRYPTO :FROM: 417,658 TO: 417,549 2 MS
|
||||
Decompress:CT_MINILZO :FROM: 417,760 TO: 417,549 2 MS
|
||||
Decompress:CT_ZLIB :FROM: 416,408 TO: 417,549 1 MS
|
||||
Decompress:CT_BZIP :FROM: 420,125 TO: 417,549 28 MS
|
||||
Decompress:CT_LIBLZF :FROM: 429,060 TO: 417,549 2 MS
|
||||
Decompress:CT_LZMA :FROM: 420,196 TO: 417,549 29 MS
|
||||
Decompress:CT_FASTLZ :FROM: 429,044 TO: 417,549 1 MS
|
||||
Decompress:CT_LZHAM :FROM: 417,575 TO: 417,549 2 MS
|
||||
```
|
||||
292
miniz_performance_comparison_v110.md
Normal file
292
miniz_performance_comparison_v110.md
Normal file
@@ -0,0 +1,292 @@
|
||||
# Introduction #
|
||||
|
||||
This page shows how miniz.c v1.10 compares to several other popular open source lossless data compression codecs at compression level 9 (max compression), with two examples at level 1 (fastest compression) on enwik8 and enwik9. The data here was generated using a slightly modified and enhanced version of [John Ratcliff's](http://en.wikipedia.org/wiki/John_W._Ratcliff) [compressiontest](http://code.google.com/p/compressiontest/) project, compiled to x64.
|
||||
|
||||
On a Core i7 3.2 GHz, miniz.c's typical decompression rate is around 175-250 MB/sec., and its typical compression rate is anywhere from 14-120.5MB/s (actual rates depend on the compression level, as well as the compressibility and redundancy present in the source data). The x64 version of the decompressor is faster than the x86 version, sometimes up to 20%, mostly due to good register utilization. miniz.c's inflater can be optionally configured to use a 64-bit bitbuffer on 64-bit CPU's, and unaligned 16 and 32-bit loads on little endian platforms (the tests below had both optimizations enabled).
|
||||
|
||||
For comparison purposes, I've added [stb\_image.c](http://nothings.org/stb_image.c)'s Inflater implementation to compresssiontest, and [LZHAM](http://code.google.com/p/lzham/) alpha7. Note that miniz.c is used for compressing the data supplied to stb\_image.c for decompression (stb\_image.c does not include a compressor, [stb\_image\_write.h](http://nothings.org/stb/stb_image_write.h) contains a simple compressor but I haven't tested it yet). Also, stb\_image.c does not compute an [Adler-32](http://en.wikipedia.org/wiki/Adler32) checksum of the uncompressed data, and miniz.c and zlib do, so stb's actual "apples to apples" performance is a little lower than reported here. (Approximately 10% of miniz.c's decompression time is spent computing the Adler32 checksum. Note, stb\_image.c is extremely useful and it inspired miniz.c -- I'm only using it as a point of reference to help compare alternate Inflate implementations against zlib.)
|
||||
|
||||
Test machine: Win7 Ultimate x64, Intel Gulftown Core i7 3.2GHz (6 cores, 12 hyperthreads), 24GB of RAM, EVGA X58 motherboard. All code was compiled with Visual Studio 2005.
|
||||
|
||||
LZHAM and LZMA where both set to use 512MB dictionary sizes in these tests.
|
||||
|
||||
**File: [enwik8](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe E:\dev\corpus\enwik8\enwik8
|
||||
x64 version
|
||||
Reading test file 'E:\dev\corpus\enwik8\enwik8' which is 100,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:100,000,000 TO: 36,460,117 63.54% 5,871 MS
|
||||
Compress:CT_MINIZ :FROM:100,000,000 TO: 36,460,117 63.54% 5,872 MS
|
||||
Compress:CT_CRYPTO :FROM:100,000,000 TO: 36,642,772 63.36% 7,501 MS
|
||||
Compress:CT_MINILZO :FROM:100,000,000 TO: 53,481,960 46.52% 868 MS
|
||||
Compress:CT_ZLIB :FROM:100,000,000 TO: 36,475,808 63.52% 7,635 MS
|
||||
Compress:CT_BZIP :FROM:100,000,000 TO: 33,259,584 66.74% 9,444 MS
|
||||
Compress:CT_LIBLZF :FROM:100,000,000 TO: 53,945,398 46.05% 688 MS
|
||||
Compress:CT_LZMA :FROM:100,000,000 TO: 24,797,518 75.20% 86,542 MS
|
||||
Compress:CT_FASTLZ :FROM:100,000,000 TO: 54,163,029 45.84% 738 MS
|
||||
Compress:CT_LZHAM :FROM:100,000,000 TO: 24,814,835 75.19% 29,200 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 36,460,117 TO:100,000,000 731 MS
|
||||
Decompress:CT_MINIZ :FROM: 36,460,117 TO:100,000,000 559 MS
|
||||
Decompress:CT_CRYPTO :FROM: 36,642,772 TO:100,000,000 1,823 MS
|
||||
Decompress:CT_MINILZO :FROM: 53,481,960 TO:100,000,000 463 MS
|
||||
Decompress:CT_ZLIB :FROM: 36,475,808 TO:100,000,000 570 MS
|
||||
Decompress:CT_BZIP :FROM: 33,259,584 TO:100,000,000 3,587 MS
|
||||
Decompress:CT_LIBLZF :FROM: 53,945,398 TO:100,000,000 429 MS
|
||||
Decompress:CT_LZMA :FROM: 24,797,518 TO:100,000,000 1,492 MS
|
||||
Decompress:CT_FASTLZ :FROM: 54,163,029 TO:100,000,000 458 MS
|
||||
Decompress:CT_LZHAM :FROM: 24,814,835 TO:100,000,000 848 MS
|
||||
```
|
||||
|
||||
**File: [enwik8](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 1 (MZ\_BEST\_SPEED), zlib set to Z\_BEST\_SPEED, all other settings are the same as above):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe E:\dev\corpus\enwik8\enwik8
|
||||
x64 version
|
||||
Reading test file 'E:\dev\corpus\enwik8\enwik8' which is 100,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:100,000,000 TO: 48,510,044 51.49% 1,159 MS
|
||||
Compress:CT_MINIZ :FROM:100,000,000 TO: 48,510,044 51.49% 1,158 MS
|
||||
Compress:CT_CRYPTO :FROM:100,000,000 TO: 36,642,772 63.36% 7,501 MS
|
||||
Compress:CT_MINILZO :FROM:100,000,000 TO: 53,481,960 46.52% 868 MS
|
||||
Compress:CT_ZLIB :FROM:100,000,000 TO: 42,298,790 57.70% 2,443 MS
|
||||
Compress:CT_BZIP :FROM:100,000,000 TO: 33,259,584 66.74% 9,431 MS
|
||||
Compress:CT_LIBLZF :FROM:100,000,000 TO: 53,945,398 46.05% 685 MS
|
||||
Compress:CT_LZMA :FROM:100,000,000 TO: 24,797,518 75.20% 86,736 MS
|
||||
Compress:CT_FASTLZ :FROM:100,000,000 TO: 54,163,029 45.84% 739 MS
|
||||
Compress:CT_LZHAM :FROM:100,000,000 TO: 24,813,424 75.19% 29,210 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 48,510,044 TO:100,000,000 987 MS
|
||||
Decompress:CT_MINIZ :FROM: 48,510,044 TO:100,000,000 718 MS
|
||||
Decompress:CT_CRYPTO :FROM: 36,642,772 TO:100,000,000 1,823 MS
|
||||
Decompress:CT_MINILZO :FROM: 53,481,960 TO:100,000,000 463 MS
|
||||
Decompress:CT_ZLIB :FROM: 42,298,790 TO:100,000,000 612 MS
|
||||
Decompress:CT_BZIP :FROM: 33,259,584 TO:100,000,000 3,563 MS
|
||||
Decompress:CT_LIBLZF :FROM: 53,945,398 TO:100,000,000 429 MS
|
||||
Decompress:CT_LZMA :FROM: 24,797,518 TO:100,000,000 1,497 MS
|
||||
Decompress:CT_FASTLZ :FROM: 54,163,029 TO:100,000,000 458 MS
|
||||
Decompress:CT_LZHAM :FROM: 24,813,424 TO:100,000,000 853 MS
|
||||
```
|
||||
|
||||
**File: [enwik9](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe E:\dev\corpus\enwik9\enwik9
|
||||
x64 version
|
||||
Reading test file 'E:\dev\corpus\enwik9\enwik9' which is 1,000,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:1,000,000,000 TO:322,771,589 67.72% 50,859 MS
|
||||
Compress:CT_MINIZ :FROM:1,000,000,000 TO:322,771,589 67.72% 50,869 MS
|
||||
Compress:CT_CRYPTO :FROM:1,000,000,000 TO:324,897,277 67.51% 65,744 MS
|
||||
Compress:CT_MINILZO :FROM:1,000,000,000 TO:477,237,740 52.28% 7,807 MS
|
||||
Compress:CT_ZLIB :FROM:1,000,000,000 TO:322,789,246 67.72% 66,571 MS
|
||||
Compress:CT_BZIP :FROM:1,000,000,000 TO:295,663,950 70.43% 94,037 MS
|
||||
Compress:CT_LIBLZF :FROM:1,000,000,000 TO:492,987,206 50.70% 6,310 MS
|
||||
Compress:CT_LZMA :FROM:1,000,000,000 TO:201,776,574 79.82% 1,043,293 MS
|
||||
Compress:CT_FASTLZ :FROM:1,000,000,000 TO:487,260,768 51.27% 6,748 MS
|
||||
Compress:CT_LZHAM :FROM:1,000,000,000 TO:202,475,460 79.75% 351,687 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM:322,771,589 TO:1,000,000,000 6,717 MS
|
||||
Decompress:CT_MINIZ :FROM:322,771,589 TO:1,000,000,000 5,050 MS
|
||||
Decompress:CT_CRYPTO :FROM:324,897,277 TO:1,000,000,000 16,770 MS
|
||||
Decompress:CT_MINILZO :FROM:477,237,740 TO:1,000,000,000 4,205 MS
|
||||
Decompress:CT_ZLIB :FROM:322,789,246 TO:1,000,000,000 5,171 MS
|
||||
Decompress:CT_BZIP :FROM:295,663,950 TO:1,000,000,000 33,298 MS
|
||||
Decompress:CT_LIBLZF :FROM:492,987,206 TO:1,000,000,000 4,025 MS
|
||||
Decompress:CT_LZMA :FROM:201,776,574 TO:1,000,000,000 12,650 MS
|
||||
Decompress:CT_FASTLZ :FROM:487,260,768 TO:1,000,000,000 4,223 MS
|
||||
Decompress:CT_LZHAM :FROM:202,475,460 TO:1,000,000,000 7,444 MS
|
||||
```
|
||||
|
||||
**File: [enwik9](http://cs.fit.edu/~mmahoney/compression/textdata.html) (miniz.c compression level 1 (MZ\_BEST\_SPEED), zlib set to Z\_BEST\_SPEED, all other settings are the same as above):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe E:\dev\corpus\enwik9\enwik9
|
||||
x64 version
|
||||
Reading test file 'E:\dev\corpus\enwik9\enwik9' which is 1,000,000,000 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:1,000,000,000 TO:436,564,069 56.34% 10,417 MS
|
||||
Compress:CT_MINIZ :FROM:1,000,000,000 TO:436,564,069 56.34% 10,418 MS
|
||||
Compress:CT_CRYPTO :FROM:1,000,000,000 TO:324,897,277 67.51% 66,169 MS
|
||||
Compress:CT_MINILZO :FROM:1,000,000,000 TO:477,237,740 52.28% 7,769 MS
|
||||
Compress:CT_ZLIB :FROM:1,000,000,000 TO:378,355,092 62.16% 21,900 MS
|
||||
Compress:CT_BZIP :FROM:1,000,000,000 TO:295,663,950 70.43% 93,694 MS
|
||||
Compress:CT_LIBLZF :FROM:1,000,000,000 TO:492,987,206 50.70% 6,326 MS
|
||||
Compress:CT_LZMA :FROM:1,000,000,000 TO:201,776,574 79.82% 1,043,293 MS
|
||||
Compress:CT_FASTLZ :FROM:1,000,000,000 TO:487,260,768 51.27% 6,756 MS
|
||||
Compress:CT_LZHAM :FROM:1,000,000,000 TO:202,475,460 79.75% 351,687 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM:436,564,069 TO:1,000,000,000 9,010 MS
|
||||
Decompress:CT_MINIZ :FROM:436,564,069 TO:1,000,000,000 6,530 MS
|
||||
Decompress:CT_CRYPTO :FROM:324,897,277 TO:1,000,000,000 16,786 MS
|
||||
Decompress:CT_MINILZO :FROM:477,237,740 TO:1,000,000,000 4,205 MS
|
||||
Decompress:CT_ZLIB :FROM:378,355,092 TO:1,000,000,000 5,612 MS
|
||||
Decompress:CT_BZIP :FROM:295,663,950 TO:1,000,000,000 33,340 MS
|
||||
Decompress:CT_LIBLZF :FROM:492,987,206 TO:1,000,000,000 3,977 MS
|
||||
Decompress:CT_LZMA :FROM:201,776,574 TO:1,000,000,000 12,650 MS
|
||||
Decompress:CT_FASTLZ :FROM:487,260,768 TO:1,000,000,000 4,214 MS
|
||||
Decompress:CT_LZHAM :FROM:202,475,460 TO:1,000,000,000 7,444 MS
|
||||
```
|
||||
|
||||
|
||||
**File: Entire Large [Calgary Corpus](http://www.data-compression.info/Corpora/CalgaryCorpus/) added to a single uncompressed 7zip archive (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe e:\dev\corpus\calgary_corpus.7z
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\calgary_corpus.7z' which is 3,251,898 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM: 3,251,898 TO: 1,065,470 67.24% 224 MS
|
||||
Compress:CT_MINIZ :FROM: 3,251,898 TO: 1,065,470 67.24% 224 MS
|
||||
Compress:CT_CRYPTO :FROM: 3,251,898 TO: 1,067,241 67.18% 240 MS
|
||||
Compress:CT_MINILZO :FROM: 3,251,898 TO: 1,581,684 51.36% 26 MS
|
||||
Compress:CT_ZLIB :FROM: 3,251,898 TO: 1,059,243 67.43% 353 MS
|
||||
Compress:CT_BZIP :FROM: 3,251,898 TO: 961,353 70.44% 277 MS
|
||||
Compress:CT_LIBLZF :FROM: 3,251,898 TO: 1,593,245 51.01% 20 MS
|
||||
Compress:CT_LZMA :FROM: 3,251,898 TO: 853,241 73.76% 1,570 MS
|
||||
Compress:CT_FASTLZ :FROM: 3,251,898 TO: 1,606,374 50.60% 21 MS
|
||||
Compress:CT_LZHAM :FROM: 3,251,898 TO: 893,578 72.52% 1,028 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 1,065,470 TO: 3,251,898 22 MS
|
||||
Decompress:CT_MINIZ :FROM: 1,065,470 TO: 3,251,898 17 MS
|
||||
Decompress:CT_CRYPTO :FROM: 1,067,241 TO: 3,251,898 54 MS
|
||||
Decompress:CT_MINILZO :FROM: 1,581,684 TO: 3,251,898 14 MS
|
||||
Decompress:CT_ZLIB :FROM: 1,059,243 TO: 3,251,898 17 MS
|
||||
Decompress:CT_BZIP :FROM: 961,353 TO: 3,251,898 104 MS
|
||||
Decompress:CT_LIBLZF :FROM: 1,593,245 TO: 3,251,898 13 MS
|
||||
Decompress:CT_LZMA :FROM: 853,241 TO: 3,251,898 55 MS
|
||||
Decompress:CT_FASTLZ :FROM: 1,606,374 TO: 3,251,898 13 MS
|
||||
Decompress:CT_LZHAM :FROM: 893,578 TO: 3,251,898 39 MS
|
||||
```
|
||||
|
||||
**File: "pic" from the Large [Calgary Corpus](http://www.data-compression.info/Corpora/CalgaryCorpus/) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe e:\dev\corpus\large_calgary_corpus\pic
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\large_calgary_corpus\pic' which is 513,216 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM: 513,216 TO: 53,721 89.53% 26 MS
|
||||
Compress:CT_MINIZ :FROM: 513,216 TO: 53,721 89.53% 26 MS
|
||||
Compress:CT_CRYPTO :FROM: 513,216 TO: 57,166 88.86% 18 MS
|
||||
Compress:CT_MINILZO :FROM: 513,216 TO: 86,304 83.18% 2 MS
|
||||
Compress:CT_ZLIB :FROM: 513,216 TO: 52,237 89.82% 96 MS
|
||||
Compress:CT_BZIP :FROM: 513,216 TO: 49,928 90.27% 17 MS
|
||||
Compress:CT_LIBLZF :FROM: 513,216 TO: 80,772 84.26% 1 MS
|
||||
Compress:CT_LZMA :FROM: 513,216 TO: 41,897 91.84% 367 MS
|
||||
Compress:CT_FASTLZ :FROM: 513,216 TO: 81,960 84.03% 1 MS
|
||||
Compress:CT_LZHAM :FROM: 513,216 TO: 47,437 90.76% 515 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 53,721 TO: 513,216 2 MS
|
||||
Decompress:CT_MINIZ :FROM: 53,721 TO: 513,216 2 MS
|
||||
Decompress:CT_CRYPTO :FROM: 57,166 TO: 513,216 4 MS
|
||||
Decompress:CT_MINILZO :FROM: 86,304 TO: 513,216 2 MS
|
||||
Decompress:CT_ZLIB :FROM: 52,237 TO: 513,216 1 MS
|
||||
Decompress:CT_BZIP :FROM: 49,928 TO: 513,216 6 MS
|
||||
Decompress:CT_LIBLZF :FROM: 80,772 TO: 513,216 1 MS
|
||||
Decompress:CT_LZMA :FROM: 41,897 TO: 513,216 4 MS
|
||||
Decompress:CT_FASTLZ :FROM: 81,960 TO: 513,216 1 MS
|
||||
Decompress:CT_LZHAM :FROM: 47,437 TO: 513,216 7 MS
|
||||
```
|
||||
|
||||
**Files: Uncompressed 7zip archive of an Adobe Acrobat Reader 9.0 installation (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe e:\dev\corpus\adobe.7z
|
||||
x64 version
|
||||
Reading test file 'e:\dev\corpus\adobe.7z' which is 146,332,683 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM:146,332,683 TO: 89,281,876 38.99% 9,780 MS
|
||||
Compress:CT_MINIZ :FROM:146,332,683 TO: 89,281,876 38.99% 9,781 MS
|
||||
Compress:CT_CRYPTO :FROM:146,332,683 TO: 91,494,418 37.48% 7,156 MS
|
||||
Compress:CT_MINILZO :FROM:146,332,683 TO:101,687,569 30.51% 1,702 MS
|
||||
Compress:CT_ZLIB :FROM:146,332,683 TO: 89,166,466 39.07% 13,143 MS
|
||||
Compress:CT_BZIP :FROM:146,332,683 TO: 89,072,636 39.13% 20,828 MS
|
||||
Compress:CT_LIBLZF :FROM:146,332,683 TO:106,352,717 27.32% 1,100 MS
|
||||
Compress:CT_LZMA :FROM:146,332,683 TO: 74,361,137 49.18% 59,076 MS
|
||||
Compress:CT_FASTLZ :FROM:146,332,683 TO:105,548,437 27.87% 1,032 MS
|
||||
Compress:CT_LZHAM :FROM:146,332,683 TO: 75,314,840 48.53% 42,354 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 89,281,876 TO:146,332,683 1,119 MS
|
||||
Decompress:CT_MINIZ :FROM: 89,281,876 TO:146,332,683 773 MS
|
||||
Decompress:CT_CRYPTO :FROM: 91,494,418 TO:146,332,683 2,142 MS
|
||||
Decompress:CT_MINILZO :FROM:101,687,569 TO:146,332,683 545 MS
|
||||
Decompress:CT_ZLIB :FROM: 89,166,466 TO:146,332,683 820 MS
|
||||
Decompress:CT_BZIP :FROM: 89,072,636 TO:146,332,683 7,101 MS
|
||||
Decompress:CT_LIBLZF :FROM:106,352,717 TO:146,332,683 565 MS
|
||||
Decompress:CT_LZMA :FROM: 74,361,137 TO:146,332,683 5,259 MS
|
||||
Decompress:CT_FASTLZ :FROM:105,548,437 TO:146,332,683 573 MS
|
||||
Decompress:CT_LZHAM :FROM: 75,314,840 TO:146,332,683 1,761 MS
|
||||
```
|
||||
|
||||
**File: miniz3\_v109.zip (a test of how well various codecs handle already compressed data) (miniz.c compression level 9):**
|
||||
```
|
||||
E:\lzham\compressiontest\test_compression>test_compression_x64.exe e:\dev\miniz3_v109.zip
|
||||
x64 version
|
||||
Reading test file 'e:\dev\miniz3_v109.zip' which is 417,549 bytes long.
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Compression rate and speed with various compressors.
|
||||
---------------------------------------------------------------
|
||||
Compress:CT_STB :FROM: 417,549 TO: 416,312 0.30% 17 MS
|
||||
Compress:CT_MINIZ :FROM: 417,549 TO: 416,312 0.30% 17 MS
|
||||
Compress:CT_CRYPTO :FROM: 417,549 TO: 417,658 -0.03% 9 MS
|
||||
Compress:CT_MINILZO :FROM: 417,549 TO: 417,760 -0.05% 7 MS
|
||||
Compress:CT_ZLIB :FROM: 417,549 TO: 416,408 0.27% 18 MS
|
||||
Compress:CT_BZIP :FROM: 417,549 TO: 420,125 -0.62% 88 MS
|
||||
Compress:CT_LIBLZF :FROM: 417,549 TO: 429,060 -2.76% 4 MS
|
||||
Compress:CT_LZMA :FROM: 417,549 TO: 420,196 -0.63% 313 MS
|
||||
Compress:CT_FASTLZ :FROM: 417,549 TO: 429,044 -2.75% 3 MS
|
||||
Compress:CT_LZHAM :FROM: 417,549 TO: 417,575 -0.01% 82 MS
|
||||
|
||||
---------------------------------------------------------------
|
||||
Testing Decompression speed with various decompressors.
|
||||
---------------------------------------------------------------
|
||||
Decompress:CT_STB :FROM: 416,312 TO: 417,549 2 MS
|
||||
Decompress:CT_MINIZ :FROM: 416,312 TO: 417,549 1 MS
|
||||
Decompress:CT_CRYPTO :FROM: 417,658 TO: 417,549 2 MS
|
||||
Decompress:CT_MINILZO :FROM: 417,760 TO: 417,549 1 MS
|
||||
Decompress:CT_ZLIB :FROM: 416,408 TO: 417,549 2 MS
|
||||
Decompress:CT_BZIP :FROM: 420,125 TO: 417,549 28 MS
|
||||
Decompress:CT_LIBLZF :FROM: 429,060 TO: 417,549 2 MS
|
||||
Decompress:CT_LZMA :FROM: 420,196 TO: 417,549 29 MS
|
||||
Decompress:CT_FASTLZ :FROM: 429,044 TO: 417,549 1 MS
|
||||
Decompress:CT_LZHAM :FROM: 417,575 TO: 417,549 2 MS
|
||||
```
|
||||
Reference in New Issue
Block a user