Skip to content

Commit

Permalink
Merge pull request #3726 from facebook/fullbench_dctx
Browse files Browse the repository at this point in the history
added ZSTD_decompressDCtx() benchmark option to fullbench
  • Loading branch information
Cyan4973 authored Aug 21, 2023
2 parents edb6e8f + a07d7c4 commit 9662fe1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/fullbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9662fe1

Please sign in to comment.