From 145c2d12f96d14c41896c91ef517404fbeaf350d Mon Sep 17 00:00:00 2001 From: Bimba Shrestha Date: Thu, 11 Jun 2020 22:54:36 -0700 Subject: [PATCH] add hashtable head prefetching --- lib/compress/zstd_lazy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c index 096980db3..fd76a55bb 100644 --- a/lib/compress/zstd_lazy.c +++ b/lib/compress/zstd_lazy.c @@ -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) { -- 2.47.2