]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
changed dictionary size, added debugging statements
authorPaul Cruz <paulcruz74@fb.com>
Tue, 11 Jul 2017 22:49:52 +0000 (15:49 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Tue, 11 Jul 2017 22:49:52 +0000 (15:49 -0700)
contrib/adaptive-compression/adapt.c

index 89a20a50ac93a6a9af10ac54c0c12362b73dc82c..ad3d7f7a6be677798930f54eaa7544160394c587 100644 (file)
@@ -253,7 +253,7 @@ static void* compressionThread(void* arg)
         {
             unsigned const cLevel = adaptCompressionLevel(ctx);
             DEBUG(3, "cLevel used: %u\n", cLevel);
-
+            DEBUG(2, "dictSize: %zu, srcSize: %zu\n", job->dict.size, job->src.size);
             /* begin compression */
             {
                 size_t const dictModeError = ZSTD_setCCtxParameter(ctx->cctx, ZSTD_p_forceRawDict, 1);
@@ -408,10 +408,10 @@ static int createCompressionJob(adaptCCtx* ctx, size_t srcSize, int last)
     pthread_mutex_unlock(&ctx->jobReady_mutex);
     DEBUG(3, "finished job creation %u\n", nextJob);
     ctx->nextJobID++;
-
+    DEBUG(3, "filled: %zu, srcSize: %zu\n", ctx->input.filled, srcSize);
     /* if not on the last job, reuse data as dictionary in next job */
     if (!last) {
-        size_t const newDictSize = srcSize;
+        size_t const newDictSize = srcSize/16;
         size_t const oldDictSize = ctx->input.filled;
         memmove(ctx->input.buffer.start, ctx->input.buffer.start + oldDictSize + srcSize - newDictSize, newDictSize);
         ctx->input.filled = newDictSize;