From: Yann Collet Date: Tue, 28 May 2019 23:50:49 +0000 (-0700) Subject: fullbench: added streaming with fresh CCtx scenario X-Git-Tag: v1.4.1^2~36^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb6b1990384364f6a3aa50bd695f87da035e202e;p=thirdparty%2Fzstd.git fullbench: added streaming with fresh CCtx scenario worst case situation, where context must be recreated every time but without knowledge of the input size thus sizing the context for some large input. --- diff --git a/tests/fullbench.c b/tests/fullbench.c index b996fc5cd..3340e9b53 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -160,6 +160,19 @@ local_ZSTD_compressStream(const void* src, size_t srcSize, return buffOut.pos; } +static size_t +local_ZSTD_compressStream_freshCCtx(const void* src, size_t srcSize, + void* dst, size_t dstCapacity, + void* buff2) +{ + ZSTD_CCtx* const cctx = ZSTD_createCCtx(); + assert(cctx != NULL); + + return local_ZSTD_compressStream(src, srcSize, dst, dstCapacity, buff2); + + ZSTD_freeCCtx(cctx); +} + static size_t local_ZSTD_compress_generic_end(const void* src, size_t srcSize, void* dst, size_t dstCapacity, @@ -354,6 +367,9 @@ static int benchMem(unsigned benchNb, case 42: benchFunction = local_ZSTD_decompressStream; benchName = "decompressStream"; break; + case 43: + benchFunction = local_ZSTD_compressStream_freshCCtx; benchName = "compressStream_freshCCtx"; + break; case 51: benchFunction = local_ZSTD_compress_generic_continue; benchName = "compress_generic, continue"; break;