]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Remove 'generic' inline strategy 582/head
authorSean Purcell <me@seanp.xyz>
Thu, 2 Mar 2017 23:15:31 +0000 (15:15 -0800)
committerSean Purcell <me@seanp.xyz>
Thu, 2 Mar 2017 23:18:13 +0000 (15:18 -0800)
Seems to avoid performance loss for compression.
Same strategy tested on decompression side, did not appear to improve
speed.

lib/compress/zstd_compress.c

index 5d81f8a380224db293c6c7cb319178a41068c9df..6b804720646904f84cbce83462cb7919ebb54df9 100644 (file)
@@ -576,11 +576,11 @@ void ZSTD_seqToCodes(const seqStore_t* seqStorePtr)
         mlCodeTable[seqStorePtr->longLengthPos] = MaxML;
 }
 
-
-FORCE_INLINE size_t ZSTD_compressSequences_generic (ZSTD_CCtx* zc,
+MEM_STATIC size_t ZSTD_compressSequences (ZSTD_CCtx* zc,
                               void* dst, size_t dstCapacity,
-                              size_t srcSize, int const longOffsets)
+                              size_t srcSize)
 {
+    const int longOffsets = zc->params.cParams.windowLog > STREAM_ACCUMULATOR_MIN;
     const seqStore_t* seqStorePtr = &(zc->seqStore);
     U32 count[MaxSeq+1];
     S16 norm[MaxSeq+1];
@@ -782,17 +782,6 @@ _check_compressibility:
     return op - ostart;
 }
 
-FORCE_INLINE size_t ZSTD_compressSequences (ZSTD_CCtx* zc,
-                              void* dst, size_t dstCapacity,
-                              size_t srcSize)
-{
-    if (zc->params.cParams.windowLog > STREAM_ACCUMULATOR_MIN) {
-        return ZSTD_compressSequences_generic(zc, dst, dstCapacity, srcSize, 1);
-    } else {
-        return ZSTD_compressSequences_generic(zc, dst, dstCapacity, srcSize, 0);
-    }
-}
-
 #if 0 /* for debug */
 #  define STORESEQ_DEBUG
 #include <stdio.h>   /* fprintf */