]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
small dictionary compression speed improvement
authorYann Collet <cyan@fb.com>
Wed, 16 Oct 2024 00:46:01 +0000 (17:46 -0700)
committerYann Collet <cyan@fb.com>
Wed, 16 Oct 2024 00:48:35 +0000 (17:48 -0700)
not as good as small-blocks improvement,
but generally positive.

lib/compress/zstd_fast.c

index e7edf949023572e6b4f074aac237af51286fb37e..5373e3640dd707f89725725510a45c4d70a37ee2 100644 (file)
@@ -597,8 +597,8 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic(
                 }
             }
 
-            if (matchIndex > prefixStartIndex && MEM_read32(match) == MEM_read32(ip0)) {
-                /* found a regular match */
+            if (ZSTD_match4Found_cmov(ip0, match, matchIndex, prefixStartIndex)) {
+                /* found a regular match of size >= 4 */
                 U32 const offset = (U32) (ip0 - match);
                 mLength = ZSTD_count(ip0 + 4, match + 4, iend) + 4;
                 while (((ip0 > anchor) & (match > prefixStart))