From: W. Felix Handte Date: Wed, 18 Aug 2021 20:02:01 +0000 (-0400) Subject: Give Up on Searching End of Block X-Git-Tag: v1.5.1~1^2~116^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c24c3e6ce8faa5a6d23ef9d11c71a0a106b3bb3;p=thirdparty%2Fzstd.git Give Up on Searching End of Block Amusingly, it seems to be a non-trivial performance hit to add in final searches or even hash table insertions during cleanup. So let's not. It seems to not make any meaningful difference in compression ratio. --- diff --git a/lib/compress/zstd_fast.c b/lib/compress/zstd_fast.c index f7df66681..50bceef74 100644 --- a/lib/compress/zstd_fast.c +++ b/lib/compress/zstd_fast.c @@ -354,10 +354,9 @@ _start: /* Requires: ip0 */ } while (ip2 < ilimit); _cleanup: - - /* Find matches at end of block. */ - - /* TODO */ + /* Note that there are probably still a couple positions we could search. + * However, it seems to be a meaningful performance hit to try to search + * them. So let's not. */ /* save reps for next block */ rep[0] = rep_offset1 ? rep_offset1 : offsetSaved;