]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Doc Updates
authorGeorge Lu <gclu@fb.com>
Wed, 1 Aug 2018 01:47:27 +0000 (18:47 -0700)
committerGeorge Lu <gclu@fb.com>
Tue, 14 Aug 2018 21:24:41 +0000 (14:24 -0700)
Add option to pass in existing parameters in use

tests/README.md
tests/paramgrill.c

index 736916936d598cb3ff4b4b830b85de28d71e8863..4d2f314d24accc56e5e69ac5dd26530a4cffce78 100644 (file)
@@ -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
index 7e85bf8329e36045733a116dcab5757bff05d37b..47e0a942126f23cfb5e0b73593f742ee0da6cacf 100644 (file)
@@ -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) {