]> git.ipfire.org Git - thirdparty/zstd.git/commit
fix initCStream_advanced() for fast strategies 1838/head
authorYann Collet <cyan@fb.com>
Tue, 22 Oct 2019 21:57:15 +0000 (14:57 -0700)
committerYann Collet <cyan@fb.com>
Tue, 22 Oct 2019 22:01:38 +0000 (15:01 -0700)
commit5d5c895b18ea54c577fdc4d89c8fd334eba4e19a
tree841be859c82bd2d8bb22a7c812c7d1e1170a3de4
parent111b0c53b02417a13f1020ef413bfe49bd6c518f
fix initCStream_advanced() for fast strategies

Compression ratio of fast strategies (levels 1 & 2)
was seriously reduced, due to accidental disabling of Literals compression.

Credit to @QrczakMK, which perfectly described the issue, and implementation details,
making the fix straightforward.

Example : initCStream with level 1 on synthetic sample P50 :
Before : 5,273,976 bytes
After  : 3,154,678 bytes
ZSTD_compress (for comparison) : 3,154,550

Fix #1787.

To follow : refactor the test which was supposed to catch this issue (and failed)
lib/compress/zstd_compress.c
tests/fullbench.c