]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
updated documentation
authorYann Collet <cyan@fb.com>
Tue, 4 Sep 2018 21:57:45 +0000 (14:57 -0700)
committerYann Collet <cyan@fb.com>
Tue, 4 Sep 2018 21:57:45 +0000 (14:57 -0700)
contrib/largeNbDicts/README.md
contrib/largeNbDicts/largeNbDicts.c

index 7eba229a9bbde2a32b33e12feacd5d995e018bcb..f29bcdfe8e37c9fcaa379f0a84cd9b19301dce27 100644 (file)
@@ -3,17 +3,23 @@ largeNbDicts
 
 `largeNbDicts` is a benchmark test tool
 dedicated to the specific scenario of
-dictionary decompression using a very large number of dictionaries,
-which suffers from increased latency due to cache misses.
-It's created in a bid to investigate performance for this scenario,
+dictionary decompression using a very large number of dictionaries.
+When dictionaries are constantly changing, they are always "cold",
+suffering from increased latency due to cache misses.
+
+The tool is created in a bid to investigate performance for this scenario,
 and experiment mitigation techniques.
 
 Command line :
 ```
-$ largeNbDicts filename [Options]
+largeNbDicts [Options] filename(s)
+
 Options :
---clevel=#     : use compression level # (default: 3)
---blockSize=#  : cut input into blocks of size # (default: 4096)
---dictionary=# : use # as a dictionary (default: create one)
---nbDicts=#    : set nb of dictionaries to # (default: one per block)
+-r           : recursively load all files in subdirectories (default: off)
+-B#          : split input into blocks of size # (default: no split)
+-#           : use compression level # (default: 3)
+-D #         : use # as a dictionary (default: create one)
+-i#          : nb benchmark rounds (default: 6)
+--nbDicts=#  : set nb of dictionaries to # (default: one per block)
+-h           : help (this text)
 ```
index 943a644d6913fd0584851c33aae76f12558b606f..21fbd2aa59d35d74c5186f7502154784d210bcc9 100644 (file)
@@ -716,17 +716,26 @@ static unsigned longCommandWArg(const char** stringPtr, const char* longCommand)
 }
 
 
+int usage(const char* exeName)
+{
+    DISPLAY (" \n");
+    DISPLAY (" %s [Options] filename(s) \n", exeName);
+    DISPLAY (" \n");
+    DISPLAY ("Options : \n");
+    DISPLAY ("-r          : recursively load all files in subdirectories (default: off) \n");
+    DISPLAY ("-B#         : split input into blocks of size # (default: no split) \n");
+    DISPLAY ("-#          : use compression level # (default: %u) \n", CLEVEL_DEFAULT);
+    DISPLAY ("-D #        : use # as a dictionary (default: create one) \n");
+    DISPLAY ("-i#         : nb benchmark rounds (default: %u) \n", BENCH_TIME_DEFAULT_S);
+    DISPLAY ("--nbDicts=# : create # dictionaries for bench (default: one per block) \n");
+    DISPLAY ("-h          : help (this text) \n");
+    return 0;
+}
+
 int bad_usage(const char* exeName)
 {
     DISPLAY (" bad usage : \n");
-    DISPLAY (" %s filename [Options] \n", exeName);
-    DISPLAY ("Options : \n");
-    DISPLAY ("-r             : recursively load all files in subdirectories (default: off) \n");
-    DISPLAY ("-B#            : split input into blocks of size # (default: no split) \n");
-    DISPLAY ("-#             : use compression level # (default: %u) \n", CLEVEL_DEFAULT);
-    DISPLAY ("-D #           : use # as a dictionary (default: create one) \n");
-    DISPLAY ("-i#            : nb benchmark rounds (default: %u) \n", BENCH_TIME_DEFAULT_S);
-    DISPLAY ("--nbDicts=#    : create # dictionaries for bench (default: one per block) \n");
+    usage(exeName);
     return 1;
 }
 
@@ -749,6 +758,7 @@ int main (int argc, const char** argv)
 
     for (int argNb = 1; argNb < argc ; argNb++) {
         const char* argument = argv[argNb];
+        if (!strcmp(argument, "-h")) { return usage(exeName); }
         if (!strcmp(argument, "-r")) { recursiveMode = 1; continue; }
         if (!strcmp(argument, "-D")) { argNb++; assert(argNb < argc); dictionary = argv[argNb]; continue; }
         if (longCommandWArg(&argument, "-i")) { nbRounds = readU32FromChar(&argument); continue; }