]> git.ipfire.org Git - thirdparty/zstd.git/commit
collect statistics for first block in ultra mode
authorYann Collet <cyan@fb.com>
Thu, 17 May 2018 19:19:37 +0000 (12:19 -0700)
committerYann Collet <cyan@fb.com>
Thu, 17 May 2018 19:24:30 +0000 (12:24 -0700)
commit134388ba6bea15bc085e1a260245bff507e41530
tree087d46d4bc8895ef7f1008afa48499e6c2529106
parenta243020d3785432b514beff05f2096d0ff72f0ca
collect statistics for first block in ultra mode

this patch makes btultra do 2 passes on the first block,
the first one being dedicated to collecting statistics
so that the 2nd pass is more accurate.

It translates into a very small compression ratio gain :

enwik7, level 20:
blocks  4K : 2.142 -> 2.153
blocks 16K : 2.447 -> 2.457
blocks 64K : 2.716 -> 2.726

On the other hand, the cpu cost is doubled.

The trade off looks bad.
Though, that's ultimately a price to pay to reach better compression ratio.
So it's only enabled when setting btultra.
lib/compress/zstd_opt.c