mirror of
https://github.com/facebook/zstd.git
synced 2025-10-06 00:04:13 -04:00
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:
parent
4c4149452c
commit
eb6b199038
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user