From f581ccd267244da3d0a4d8d6ba1cb8a1b191bfd8 Mon Sep 17 00:00:00 2001 From: George Lu Date: Tue, 31 Jul 2018 18:47:27 -0700 Subject: [PATCH] Doc Updates Add option to pass in existing parameters in use --- tests/README.md | 4 ++-- tests/paramgrill.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/README.md b/tests/README.md index 736916936..4d2f314d2 100644 --- a/tests/README.md +++ b/tests/README.md @@ -105,7 +105,8 @@ Full list of arguments t# - targetLength S# - strategy L# - level - --zstd= : Single run, parameter selection syntax same as zstdcli + --zstd= : Single run, parameter selection syntax same as zstdcli. + When invoked with --optimize, this represents the sample to exceed. --optimize= : find parameters to maximize compression ratio given parameters Can use all --zstd= commands to constrain the type of solution found in addition to the following constraints cSpeed= : Minimum compression speed @@ -120,7 +121,6 @@ Full list of arguments when determining overall winner (default 1 for both, higher = more valued). tries= : Maximum number of random restarts on a single strategy before switching (Default 5) Higher values will make optimizer run longer, more chances to find better solution. - --optimize= : same as -O with more verbose syntax -P# : generated sample compressibility -t# : Caps runtime of operation in seconds (default : 99999 seconds (about 27 hours )) -v : Prints Benchmarking output diff --git a/tests/paramgrill.c b/tests/paramgrill.c index 7e85bf832..47e0a9421 100644 --- a/tests/paramgrill.c +++ b/tests/paramgrill.c @@ -2234,6 +2234,19 @@ static int optimizeForSize(const char* const * const fileNamesTable, const size_ BMK_printWinnerOpt(stdout, cLevel, winner.result, winner.params, target, buf.srcSize); } + if(g_singleRun) { + BMK_result_t res; + g_params = ZSTD_adjustCParams(maskParams(ZSTD_getCParams(cLevel, maxBlockSize, ctx.dictSize), g_params), maxBlockSize, ctx.dictSize); + if(BMK_benchParam(&res, buf, ctx, g_params)) { + ret = 45; + goto _cleanUp; + } + if(compareResultLT(winner.result, res, relaxTarget(target), buf.srcSize)) { + winner.result = res; + winner.params = g_params; + } + } + /* bench */ DISPLAY("\r%79s\r", ""); if(nbFiles == 1) {