From: Yann Collet Date: Tue, 16 Feb 2016 16:41:03 +0000 (+0100) Subject: performance fix for hash chain mode X-Git-Tag: v0.5.1^2~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6062b15a073eca53ceadaa86a577e5c413246a5e;p=thirdparty%2Fzstd.git performance fix for hash chain mode --- diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index 457161565..389cf4f7c 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -1411,7 +1411,8 @@ static size_t ZSTD_BtFindBestMatch_selectMLS_extDict ( /* Update chains up to ip (excluded) Assumption : always within prefix (ie. not within extDict) */ -static U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls) +FORCE_INLINE +U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls) { U32* const hashTable = zc->hashTable; const U32 hashLog = zc->params.hashLog; @@ -1613,7 +1614,7 @@ void ZSTD_compressBlock_lazy_generic(ZSTD_CCtx* ctx, break; /* nothing found : store previous solution */ } - /* catch up */ + /* catch up */ if (offset) { while ((start>anchor) && (start>base+offset) && (start[-1] == start[-1-offset])) /* only search for offset within prefix */ { start--; matchLength++; }