From: Yann Collet Date: Wed, 16 Aug 2023 17:43:39 +0000 (-0700) Subject: added ZSTD_decompressDCtx() benchmark option to fullbench X-Git-Tag: v1.5.6^2~133^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a07d7c4e29f9329a1c98fbecc2e54ed6b663caef;p=thirdparty%2Fzstd.git added ZSTD_decompressDCtx() benchmark option to fullbench useful to compare the difference between ZSTD_decompress and ZSTD_decompressDCtx(). --- diff --git a/tests/fullbench.c b/tests/fullbench.c index 0391107b9..c8f0c0af1 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -138,7 +138,14 @@ static size_t local_ZSTD_decompress(const void* src, size_t srcSize, return ZSTD_decompress(dst, dstSize, buff2, g_cSize); } -static ZSTD_DCtx* g_zdc = NULL; +static ZSTD_DCtx* g_zdc = NULL; /* will be initialized within benchMem */ +static size_t local_ZSTD_decompressDCtx(const void* src, size_t srcSize, + void* dst, size_t dstSize, + void* buff2) +{ + (void)src; (void)srcSize; + return ZSTD_decompressDCtx(g_zdc, dst, dstSize, buff2, g_cSize); +} #ifndef ZSTD_DLL_IMPORT @@ -452,6 +459,9 @@ static int benchMem(unsigned benchNb, case 3: benchFunction = local_ZSTD_compress_freshCCtx; benchName = "compress_freshCCtx"; break; + case 4: + benchFunction = local_ZSTD_decompressDCtx; benchName = "decompressDCtx"; + break; #ifndef ZSTD_DLL_IMPORT case 11: benchFunction = local_ZSTD_compressContinue; benchName = "compressContinue"; @@ -551,6 +561,9 @@ static int benchMem(unsigned benchNb, case 3: payload = &cparams; break; + case 4: + g_cSize = ZSTD_compress(dstBuff2, dstBuffSize, src, srcSize, cLevel); + break; #ifndef ZSTD_DLL_IMPORT case 11: payload = &cparams;