]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
add hashtable head prefetching
authorBimba Shrestha <bimbashrestha@fb.com>
Fri, 12 Jun 2020 05:54:36 +0000 (22:54 -0700)
committerW. Felix Handte <w@felixhandte.com>
Thu, 10 Sep 2020 22:51:52 +0000 (18:51 -0400)
lib/compress/zstd_lazy.c

index 096980db31707d7dec81e585a3d3759de0fbff8e..fd76a55bbeba948d55b5c2708f3eac768ea6019a 100644 (file)
@@ -525,6 +525,11 @@ size_t ZSTD_HcFindBestMatch_generic (
     /* HC4 match finder */
     U32 matchIndex = ZSTD_insertAndFindFirstIndex_internal(ms, cParams, ip, mls);
 
+    if (dictMode == ZSTD_dictMatchState && ms->dictMatchState->enableDedicatedDictSearch)
+        PREFETCH_L1(ms->dictMatchState->hashTable +
+            (ZSTD_hashPtr(ip, ms->dictMatchState->cParams.hashLog - DD_BLOG,
+            ms->dictMatchState->cParams.minMatch) << DD_BLOG));
+
     for ( ; (matchIndex>lowLimit) & (nbAttempts>0) ; nbAttempts--) {
         size_t currentMl=0;
         if ((dictMode != ZSTD_extDict) || matchIndex >= dictLimit) {