inikep / lzbench

lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors
885 stars 179 forks source link

Fix windowLog comparison in Zstd boilerplate #58

Open andywilco opened 4 years ago

andywilco commented 4 years ago

Comparison sense is reversed so windowLog larger than default is never applied.

inikep commented 4 years ago

The windowLog is used to limit an LZ dictionary window for e.g zstd22:

Compressor name         Compress. Decompress. Compr. size  Ratio
zstd 1.4.3 -19           3.73 MB/s  1078 MB/s    53254304  25.13
zstd22 1.4.3 -19         4.28 MB/s  1096 MB/s    54110538  25.53
andywilco commented 4 years ago

Hmm maybe I need a more comprehensive fix. It seems reasonable to pass a larger windowLog much like the --long argument, otherwise windowLog is capped at default. zstd30LDM added for example.

Without patch:

Compressor name         Compress. Decompress. Compr. size  Ratio
zstd 1.3.8 -1             318 MB/s   680 MB/s    19468263  15.21
zstdLDM 1.3.8 -1          144 MB/s   712 MB/s    18639432  14.56
zstd22LDM 1.3.8 -1        143 MB/s   715 MB/s    18639432  14.56
zstd24LDM 1.3.8 -1        146 MB/s   721 MB/s    18639432  14.56
zstd30LDM 1.3.8 -1        147 MB/s   726 MB/s    18639432  14.56 

With patch:

Compressor name         Compress. Decompress. Compr. size  Ratio
zstd 1.3.8 -1             317 MB/s   711 MB/s    19468263  15.21
zstdLDM 1.3.8 -1          146 MB/s   730 MB/s    18639432  14.56
zstd22LDM 1.3.8 -1        138 MB/s   758 MB/s    17545488  13.71
zstd24LDM 1.3.8 -1        136 MB/s   833 MB/s    15620953  12.20
zstd30LDM 1.3.8 -1        124 MB/s   893 MB/s    13035351  10.18

inikep commented 4 years ago

I think it can be done by renaming windowLog with limitWindowLog and adding a new parameter increaseWindowLog.