Merge pull request #2355 from senhuang42/change_ldm_mt_config

Reduce --long mode MT jobsize at higher levels
dev
Yann Collet 2020-10-16 13:35:50 -07:00 committed by GitHub
commit a0ec50c2dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1192,8 +1192,8 @@ static unsigned ZSTDMT_computeTargetJobLog(const ZSTD_CCtx_params* params)
if (params->ldmParams.enableLdm) { if (params->ldmParams.enableLdm) {
/* In Long Range Mode, the windowLog is typically oversized. /* In Long Range Mode, the windowLog is typically oversized.
* In which case, it's preferable to determine the jobSize * In which case, it's preferable to determine the jobSize
* based on chainLog instead. */ * based on cycleLog instead. */
jobLog = MAX(21, params->cParams.chainLog + 4); jobLog = MAX(21, ZSTD_cycleLog(params->cParams.chainLog, params->cParams.strategy) + 3);
} else { } else {
jobLog = MAX(20, params->cParams.windowLog + 2); jobLog = MAX(20, params->cParams.windowLog + 2);
} }

View File

@ -909,7 +909,7 @@ static void FIO_adjustParamsForPatchFromMode(FIO_prefs_t* const prefs,
if (fileWindowLog > ZSTD_WINDOWLOG_MAX) if (fileWindowLog > ZSTD_WINDOWLOG_MAX)
DISPLAYLEVEL(1, "Max window log exceeded by file (compression ratio will suffer)\n"); DISPLAYLEVEL(1, "Max window log exceeded by file (compression ratio will suffer)\n");
comprParams->windowLog = MIN(ZSTD_WINDOWLOG_MAX, fileWindowLog); comprParams->windowLog = MIN(ZSTD_WINDOWLOG_MAX, fileWindowLog);
if (fileWindowLog > ZSTD_cycleLog(cParams.hashLog, cParams.strategy)) { if (fileWindowLog > ZSTD_cycleLog(cParams.chainLog, cParams.strategy)) {
if (!prefs->ldmFlag) if (!prefs->ldmFlag)
DISPLAYLEVEL(1, "long mode automatically triggered\n"); DISPLAYLEVEL(1, "long mode automatically triggered\n");
FIO_setLdmFlag(prefs, 1); FIO_setLdmFlag(prefs, 1);