From a494111385bd7d61dbf8f4e3d817e51d2ba6a81c Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Thu, 13 Aug 2020 14:54:10 -0400 Subject: [PATCH] Move Prefetch Before Insertion; Speed Up ~6% --- lib/compress/zstd_lazy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c index 45b248472..0ee9f6506 100644 --- a/lib/compress/zstd_lazy.c +++ b/lib/compress/zstd_lazy.c @@ -531,14 +531,14 @@ size_t ZSTD_HcFindBestMatch_generic ( U32 matchIndex; - /* HC4 match finder */ - matchIndex = ZSTD_insertAndFindFirstIndex_internal(ms, cParams, ip, mls); - if (dictMode == ZSTD_dedicatedDictSearch) { const U32* entry = &dms->hashTable[ddsIdx]; PREFETCH_L1(entry); } + /* HC4 match finder */ + matchIndex = ZSTD_insertAndFindFirstIndex_internal(ms, cParams, ip, mls); + for ( ; (matchIndex>lowLimit) & (nbAttempts>0) ; nbAttempts--) { size_t currentMl=0; if ((dictMode != ZSTD_extDict) || matchIndex >= dictLimit) {