inikep / lizard

Lizard (formerly LZ5) is an efficient compressor with very fast decompression. It achieves compression ratio that is comparable to zip/zlib and zstd/brotli (at low and medium compression levels) at decompression speed of 1000 MB/s and faster.
Other
644 stars 40 forks source link

My own Win-64 build version get worse compression ratio than lizard-1.0-windows #17

Closed yunhua-deng closed 5 years ago

yunhua-deng commented 6 years ago

Compiler: Visual Studio 2017 64-Bit Community Edition OS: Windows 10 64-bit Binary size: my version lizard-MyBuild.exe (200+ KB) v.s. official version lizard.exe (500+KB) File to compress: some Android firmware image (namely, "system-other.img")

As you can see from the results attached below, compression ratio of lizard-MyBuild.exe is always not as good as the lizard.exe given the same level (e.g., 25, 29, 45, 49). Any idea on this difference?

Compression ratio of lizard-MyBuild.exe:

Compression ratio of lizard.exe:

inikep commented 6 years ago

This is probably related to searching matches in a hash table.

  1. 32-bit compilation can give slightly lower ratio than 64-bit.
  2. Please try compilation with defined LIZARD_RESET_MEM. It will clear a hash table at start of compression. This step is normally skipped to make compression faster.
yunhua-deng commented 6 years ago
  1. 32-bit compilation can give slightly lower ratio than 64-bit.

Yep, my 64-bit complication slightly beats 32-bit one regarding the ratio.

  1. Please try compilation with defined LIZARD_RESET_MEM. It will clear a hash table at start of compression. This step is normally skipped to make compression faster.

I added #define LIZARD_RESET_MEM TRUE to lizard_compress.c, but no luck, made no difference in my case.

Wondering how did you make the complication using Visual Studio, what are the configurations?

inikep commented 5 years ago

Projects for VS are included in this repo. More information at https://github.com/inikep/lizard/tree/lizard/visual