changed parameter name to ZSTD_c_overlapLog
from overlapSizeLog. Reasoning : `overlapLog` is already used everwhere, in the code, command line and documentation. `ZSTD_c_overlapSizeLog` feels unnecessarily different.dev
parent
5e6aaa3abb
commit
9b784dec7f
|
@ -445,7 +445,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
||||||
* , for all strategies > fast, effective maximum is 6.
|
* , for all strategies > fast, effective maximum is 6.
|
||||||
* Special: value 0 means "use default minMatchLength". */
|
* Special: value 0 means "use default minMatchLength". */
|
||||||
ZSTD_c_targetLength=106, </b>/* Impact of this field depends on strategy.<b>
|
ZSTD_c_targetLength=106, </b>/* Impact of this field depends on strategy.<b>
|
||||||
* For strategies btopt & btultra:
|
* For strategies btopt, btultra & btultra2:
|
||||||
* Length of Match considered "good enough" to stop search.
|
* Length of Match considered "good enough" to stop search.
|
||||||
* Larger values make compression stronger, and slower.
|
* Larger values make compression stronger, and slower.
|
||||||
* For strategy fast:
|
* For strategy fast:
|
||||||
|
@ -506,15 +506,20 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
||||||
ZSTD_c_jobSize=401, </b>/* Size of a compression job. This value is enforced only when nbWorkers >= 1.<b>
|
ZSTD_c_jobSize=401, </b>/* Size of a compression job. This value is enforced only when nbWorkers >= 1.<b>
|
||||||
* Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
|
* Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
|
||||||
* 0 means default, which is dynamically determined based on compression parameters.
|
* 0 means default, which is dynamically determined based on compression parameters.
|
||||||
* Job size must be a minimum of overlapSize, or 1 MB, whichever is largest.
|
* Job size must be a minimum of overlap size, or 1 MB, whichever is largest.
|
||||||
* The minimum size is automatically and transparently enforced */
|
* The minimum size is automatically and transparently enforced */
|
||||||
ZSTD_c_overlapSizeLog=402, </b>/* Size of previous job reloaded at the beginning of each job, as a fraction of window size.<b>
|
ZSTD_c_overlapLog=402, </b>/* Control the overlap size, as a fraction of window size.<b>
|
||||||
|
* The overlap size is an amount of data reloaded from previous job at the beginning of a new job.
|
||||||
|
* It helps preserve compression ratio, while each job is compressed in parallel.
|
||||||
* This value is enforced only when nbWorkers >= 1.
|
* This value is enforced only when nbWorkers >= 1.
|
||||||
* Larger values increase compression ratio, but decrease speed.
|
* Larger values increase compression ratio, but decrease speed.
|
||||||
* Values range from 0 (no overlap) to 9 (overlap a full windowSize).
|
* Values range from 0 to 9 (overlap a full windowSize).
|
||||||
* Each rank (except 0) increase/decrease load size by a factor 2
|
* - 0 means "auto" : value will be determined by the library, depending on strategy
|
||||||
* 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:w/256;
|
* - 1 means "no overlap"
|
||||||
* default value is 6 : use 1/8th of windowSize */
|
* - 9 means "full overlap", using a full window size.
|
||||||
|
* Each intermediate rank increases/decreases load size by a factor 2 :
|
||||||
|
* 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:auto
|
||||||
|
* default value varies between 6 and 9, depending on strategy */
|
||||||
|
|
||||||
</b>/* note : additional experimental parameters are also available<b>
|
</b>/* note : additional experimental parameters are also available<b>
|
||||||
* within the experimental section of the API.
|
* within the experimental section of the API.
|
||||||
|
|
|
@ -305,7 +305,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
|
||||||
#endif
|
#endif
|
||||||
return bounds;
|
return bounds;
|
||||||
|
|
||||||
case ZSTD_c_overlapSizeLog:
|
case ZSTD_c_overlapLog:
|
||||||
bounds.lowerBound = ZSTD_OVERLAPLOG_MIN;
|
bounds.lowerBound = ZSTD_OVERLAPLOG_MIN;
|
||||||
bounds.upperBound = ZSTD_OVERLAPLOG_MAX;
|
bounds.upperBound = ZSTD_OVERLAPLOG_MAX;
|
||||||
return bounds;
|
return bounds;
|
||||||
|
@ -404,7 +404,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param)
|
||||||
case ZSTD_c_forceMaxWindow :
|
case ZSTD_c_forceMaxWindow :
|
||||||
case ZSTD_c_nbWorkers:
|
case ZSTD_c_nbWorkers:
|
||||||
case ZSTD_c_jobSize:
|
case ZSTD_c_jobSize:
|
||||||
case ZSTD_c_overlapSizeLog:
|
case ZSTD_c_overlapLog:
|
||||||
case ZSTD_c_rsyncable:
|
case ZSTD_c_rsyncable:
|
||||||
case ZSTD_c_enableLongDistanceMatching:
|
case ZSTD_c_enableLongDistanceMatching:
|
||||||
case ZSTD_c_ldmHashLog:
|
case ZSTD_c_ldmHashLog:
|
||||||
|
@ -466,7 +466,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value)
|
||||||
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
|
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
|
||||||
|
|
||||||
case ZSTD_c_jobSize:
|
case ZSTD_c_jobSize:
|
||||||
case ZSTD_c_overlapSizeLog:
|
case ZSTD_c_overlapLog:
|
||||||
case ZSTD_c_rsyncable:
|
case ZSTD_c_rsyncable:
|
||||||
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
|
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
|
||||||
|
|
||||||
|
@ -587,7 +587,7 @@ size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* CCtxParams,
|
||||||
return ZSTDMT_CCtxParam_setMTCtxParameter(CCtxParams, ZSTDMT_p_jobSize, value);
|
return ZSTDMT_CCtxParam_setMTCtxParameter(CCtxParams, ZSTDMT_p_jobSize, value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ZSTD_c_overlapSizeLog :
|
case ZSTD_c_overlapLog :
|
||||||
#ifndef ZSTD_MULTITHREAD
|
#ifndef ZSTD_MULTITHREAD
|
||||||
return ERROR(parameter_unsupported);
|
return ERROR(parameter_unsupported);
|
||||||
#else
|
#else
|
||||||
|
@ -698,7 +698,7 @@ size_t ZSTD_CCtxParam_getParameter(
|
||||||
*value = CCtxParams->jobSize;
|
*value = CCtxParams->jobSize;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case ZSTD_c_overlapSizeLog :
|
case ZSTD_c_overlapLog :
|
||||||
#ifndef ZSTD_MULTITHREAD
|
#ifndef ZSTD_MULTITHREAD
|
||||||
return ERROR(parameter_unsupported);
|
return ERROR(parameter_unsupported);
|
||||||
#else
|
#else
|
||||||
|
@ -4012,8 +4012,8 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,
|
||||||
if (cctx->streamStage == zcss_init) {
|
if (cctx->streamStage == zcss_init) {
|
||||||
ZSTD_CCtx_params params = cctx->requestedParams;
|
ZSTD_CCtx_params params = cctx->requestedParams;
|
||||||
ZSTD_prefixDict const prefixDict = cctx->prefixDict;
|
ZSTD_prefixDict const prefixDict = cctx->prefixDict;
|
||||||
memset(&cctx->prefixDict, 0, sizeof(cctx->prefixDict)); /* single usage */
|
memset(&cctx->prefixDict, 0, sizeof(cctx->prefixDict)); /* single usage */
|
||||||
assert(prefixDict.dict==NULL || cctx->cdict==NULL); /* only one can be set */
|
assert(prefixDict.dict==NULL || cctx->cdict==NULL); /* only one can be set */
|
||||||
DEBUGLOG(4, "ZSTD_compressStream2 : transparent init stage");
|
DEBUGLOG(4, "ZSTD_compressStream2 : transparent init stage");
|
||||||
if (endOp == ZSTD_e_end) cctx->pledgedSrcSizePlusOne = input->size + 1; /* auto-fix pledgedSrcSize */
|
if (endOp == ZSTD_e_end) cctx->pledgedSrcSizePlusOne = input->size + 1; /* auto-fix pledgedSrcSize */
|
||||||
params.cParams = ZSTD_getCParamsFromCCtxParams(
|
params.cParams = ZSTD_getCParamsFromCCtxParams(
|
||||||
|
|
17
lib/zstd.h
17
lib/zstd.h
|
@ -602,15 +602,20 @@ typedef enum {
|
||||||
ZSTD_c_jobSize=401, /* Size of a compression job. This value is enforced only when nbWorkers >= 1.
|
ZSTD_c_jobSize=401, /* Size of a compression job. This value is enforced only when nbWorkers >= 1.
|
||||||
* Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
|
* Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
|
||||||
* 0 means default, which is dynamically determined based on compression parameters.
|
* 0 means default, which is dynamically determined based on compression parameters.
|
||||||
* Job size must be a minimum of overlapSize, or 1 MB, whichever is largest.
|
* Job size must be a minimum of overlap size, or 1 MB, whichever is largest.
|
||||||
* The minimum size is automatically and transparently enforced */
|
* The minimum size is automatically and transparently enforced */
|
||||||
ZSTD_c_overlapSizeLog=402, /* Size of previous job reloaded at the beginning of each job, as a fraction of window size.
|
ZSTD_c_overlapLog=402, /* Control the overlap size, as a fraction of window size.
|
||||||
|
* The overlap size is an amount of data reloaded from previous job at the beginning of a new job.
|
||||||
|
* It helps preserve compression ratio, while each job is compressed in parallel.
|
||||||
* This value is enforced only when nbWorkers >= 1.
|
* This value is enforced only when nbWorkers >= 1.
|
||||||
* Larger values increase compression ratio, but decrease speed.
|
* Larger values increase compression ratio, but decrease speed.
|
||||||
* Values range from 0 (no overlap) to 9 (overlap a full windowSize).
|
* Values range from 0 to 9 (overlap a full windowSize).
|
||||||
* Each rank (except 0) increase/decrease load size by a factor 2
|
* - 0 means "auto" : value will be determined by the library, depending on strategy
|
||||||
* 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:w/256;
|
* - 1 means "no overlap"
|
||||||
* default value is 6 : use 1/8th of windowSize */
|
* - 9 means "full overlap", using a full window size.
|
||||||
|
* Each intermediate rank increases/decreases load size by a factor 2 :
|
||||||
|
* 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:auto
|
||||||
|
* default value varies between 6 and 9, depending on strategy */
|
||||||
|
|
||||||
/* note : additional experimental parameters are also available
|
/* note : additional experimental parameters are also available
|
||||||
* within the experimental section of the API.
|
* within the experimental section of the API.
|
||||||
|
|
|
@ -562,7 +562,7 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel,
|
||||||
g_overlapLog = 9; /* full overlap */
|
g_overlapLog = 9; /* full overlap */
|
||||||
if (g_overlapLog != FIO_OVERLAP_LOG_NOTSET) {
|
if (g_overlapLog != FIO_OVERLAP_LOG_NOTSET) {
|
||||||
DISPLAYLEVEL(3,"set overlapLog = %u \n", g_overlapLog);
|
DISPLAYLEVEL(3,"set overlapLog = %u \n", g_overlapLog);
|
||||||
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_overlapSizeLog, g_overlapLog) );
|
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_overlapLog, g_overlapLog) );
|
||||||
}
|
}
|
||||||
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_rsyncable, g_rsyncable) );
|
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_rsyncable, g_rsyncable) );
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -95,7 +95,7 @@ static size_t cctxParamRoundTripTest(void* resultBuff, size_t resultBuffCapacity
|
||||||
/* Set parameters */
|
/* Set parameters */
|
||||||
CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_c_compressionLevel, cLevel) );
|
CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_c_compressionLevel, cLevel) );
|
||||||
CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_c_nbWorkers, 2) );
|
CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_c_nbWorkers, 2) );
|
||||||
CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_c_overlapSizeLog, 5) );
|
CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_c_overlapLog, 5) );
|
||||||
|
|
||||||
|
|
||||||
/* Apply parameters */
|
/* Apply parameters */
|
||||||
|
|
|
@ -1904,7 +1904,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest,
|
||||||
CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_c_nbWorkers, nbThreads, opaqueAPI) );
|
CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_c_nbWorkers, nbThreads, opaqueAPI) );
|
||||||
if (nbThreads > 1) {
|
if (nbThreads > 1) {
|
||||||
U32 const jobLog = FUZ_rand(&lseed) % (testLog+1);
|
U32 const jobLog = FUZ_rand(&lseed) % (testLog+1);
|
||||||
CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_c_overlapSizeLog, FUZ_rand(&lseed) % 10, opaqueAPI) );
|
CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_c_overlapLog, FUZ_rand(&lseed) % 10, opaqueAPI) );
|
||||||
CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_c_jobSize, (U32)FUZ_rLogLength(&lseed, jobLog), opaqueAPI) );
|
CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_c_jobSize, (U32)FUZ_rLogLength(&lseed, jobLog), opaqueAPI) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue