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.
This commit is contained in:
Yann Collet 2019-05-28 16:50:49 -07:00
parent 4c4149452c
commit eb6b199038

View File

@ -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;