1ZSTD(1) User Commands ZSTD(1)
2
3
4
6 zstd - zstd, zstdmt, unzstd, zstdcat - Compress or decompress .zst
7 files
8
10 zstdmt is equivalent to zstd -T0
11
12 unzstd is equivalent to zstd -d
13
14 zstdcat is equivalent to zstd -dcf
15
17 zstd is a fast lossless compression algorithm and data compression
18 tool, with command line syntax similar to gzip(1) and xz(1). It is
19 based on the LZ77 family, with further FSE & huff0 entropy stages. zstd
20 offers highly configurable compression speed, from fast modes at > 200
21 MB/s per core, to strong modes with excellent compression ratios. It
22 also features a very fast decoder, with speeds > 500 MB/s per core.
23
24 zstd command line syntax is generally similar to gzip, but features the
25 following differences:
26
27 ○ Source files are preserved by default. It´s possible to remove them
28 automatically by using the --rm command.
29
30 ○ When compressing a single file, zstd displays progress notifica‐
31 tions and result summary by default. Use -q to turn them off.
32
33 ○ zstd displays a short help page when command line is an error. Use
34 -q to turn it off.
35
36 ○ zstd does not accept input from console, though it does accept
37 stdin when it´s not the console.
38
39 ○ zstd does not store the input´s filename or attributes, only its
40 contents.
41
42
43
44 zstd processes each file according to the selected operation mode. If
45 no files are given or file is -, zstd reads from standard input and
46 writes the processed data to standard output. zstd will refuse to write
47 compressed data to standard output if it is a terminal: it will display
48 an error message and skip the file. Similarly, zstd will refuse to read
49 compressed data from standard input if it is a terminal.
50
51 Unless --stdout or -o is specified, files are written to a new file
52 whose name is derived from the source file name:
53
54 ○ When compressing, the suffix .zst is appended to the source file‐
55 name to get the target filename.
56
57 ○ When decompressing, the .zst suffix is removed from the source
58 filename to get the target filename
59
60
61
62 Concatenation with .zst Files
63 It is possible to concatenate multiple .zst files. zstd will decompress
64 such agglomerated file as if it was a single .zst file.
65
67 Integer Suffixes and Special Values
68 In most places where an integer argument is expected, an optional suf‐
69 fix is supported to easily indicate large integers. There must be no
70 space between the integer and the suffix.
71
72 KiB Multiply the integer by 1,024 (2\^10). Ki, K, and KB are ac‐
73 cepted as synonyms for KiB.
74
75 MiB Multiply the integer by 1,048,576 (2\^20). Mi, M, and MB are ac‐
76 cepted as synonyms for MiB.
77
78 Operation Mode
79 If multiple operation mode options are given, the last one takes ef‐
80 fect.
81
82 -z, --compress
83 Compress. This is the default operation mode when no operation
84 mode option is specified and no other operation mode is implied
85 from the command name (for example, unzstd implies --decom‐
86 press).
87
88 -d, --decompress, --uncompress
89 Decompress.
90
91 -t, --test
92 Test the integrity of compressed files. This option is equiva‐
93 lent to --decompress --stdout > /dev/null, decompressed data is
94 discarded and checksummed for errors. No files are created or
95 removed.
96
97 -b# Benchmark file(s) using compression level #. See BENCHMARK below
98 for a description of this operation.
99
100 --train FILES
101 Use FILES as a training set to create a dictionary. The training
102 set should contain a lot of small files (> 100). See DICTIONARY
103 BUILDER below for a description of this operation.
104
105 -l, --list
106 Display information related to a zstd compressed file, such as
107 size, ratio, and checksum. Some of these fields may not be
108 available. This command´s output can be augmented with the -v
109 modifier.
110
111 Operation Modifiers
112 ○ -#: selects # compression level [1-19] (default: 3)
113
114 ○ --ultra: unlocks high compression levels 20+ (maximum 22), using a
115 lot more memory. Note that decompression will also require more
116 memory when using these levels.
117
118 ○ --fast[=#]: switch to ultra-fast compression levels. If =# is not
119 present, it defaults to 1. The higher the value, the faster the
120 compression speed, at the cost of some compression ratio. This set‐
121 ting overwrites compression level if one was set previously. Simi‐
122 larly, if a compression level is set after --fast, it overrides it.
123
124 ○ -T#, --threads=#: Compress using # working threads (default: 1). If
125 # is 0, attempt to detect and use the number of physical CPU cores.
126 In all cases, the nb of threads is capped to ZSTDMT_NBWORKERS_MAX,
127 which is either 64 in 32-bit mode, or 256 for 64-bit environments.
128 This modifier does nothing if zstd is compiled without multithread
129 support.
130
131 ○ --single-thread: Use a single thread for both I/O and compression.
132 As compression is serialized with I/O, this can be slightly slower.
133 Single-thread mode features significantly lower memory usage, which
134 can be useful for systems with limited amount of memory, such as
135 32-bit systems.
136
137 Note 1: this mode is the only available one when multithread sup‐
138 port is disabled.
139
140 Note 2: this mode is different from -T1, which spawns 1 compression
141 thread in parallel with I/O. Final compressed result is also
142 slightly different from -T1.
143
144 ○ --auto-threads={physical,logical} (default: physical): When using a
145 default amount of threads via -T0, choose the default based on the
146 number of detected physical or logical cores.
147
148 ○ --adapt[=min=#,max=#]: zstd will dynamically adapt compression
149 level to perceived I/O conditions. Compression level adaptation can
150 be observed live by using command -v. Adaptation can be constrained
151 between supplied min and max levels. The feature works when com‐
152 bined with multi-threading and --long mode. It does not work with
153 --single-thread. It sets window size to 8 MiB by default (can be
154 changed manually, see wlog). Due to the chaotic nature of dynamic
155 adaptation, compressed result is not reproducible.
156
157 Note: at the time of this writing, --adapt can remain stuck at low
158 speed when combined with multiple worker threads (>=2).
159
160 ○ --long[=#]: enables long distance matching with # windowLog, if #
161 is not present it defaults to 27. This increases the window size
162 (windowLog) and memory usage for both the compressor and decompres‐
163 sor. This setting is designed to improve the compression ratio for
164 files with long matches at a large distance.
165
166 Note: If windowLog is set to larger than 27, --long=windowLog or
167 --memory=windowSize needs to be passed to the decompressor.
168
169 ○ -D DICT: use DICT as Dictionary to compress or decompress FILE(s)
170
171 ○ --patch-from FILE: Specify the file to be used as a reference point
172 for zstd´s diff engine. This is effectively dictionary compression
173 with some convenient parameter selection, namely that windowSize >
174 srcSize.
175
176 Note: cannot use both this and -D together.
177
178 Note: --long mode will be automatically activated if chainLog <
179 fileLog (fileLog being the windowLog required to cover the whole
180 file). You can also manually force it.
181
182 Note: for all levels, you can use --patch-from in --single-thread
183 mode to improve compression ratio at the cost of speed.
184
185 Note: for level 19, you can get increased compression ratio at the
186 cost of speed by specifying --zstd=targetLength= to be something
187 large (i.e. 4096), and by setting a large --zstd=chainLog=.
188
189 ○ --rsyncable: zstd will periodically synchronize the compression
190 state to make the compressed file more rsync-friendly. There is a
191 negligible impact to compression ratio, and a potential impact to
192 compression speed, perceptible at higher speeds, for example when
193 combining --rsyncable with many parallel worker threads. This fea‐
194 ture does not work with --single-thread. You probably don´t want to
195 use it with long range mode, since it will decrease the effective‐
196 ness of the synchronization points, but your mileage may vary.
197
198 ○ -C, --[no-]check: add integrity check computed from uncompressed
199 data (default: enabled)
200
201 ○ --[no-]content-size: enable / disable whether or not the original
202 size of the file is placed in the header of the compressed file.
203 The default option is --content-size (meaning that the original
204 size will be placed in the header).
205
206 ○ --no-dictID: do not store dictionary ID within frame header (dic‐
207 tionary compression). The decoder will have to rely on implicit
208 knowledge about which dictionary to use, it won´t be able to check
209 if it´s correct.
210
211 ○ -M#, --memory=#: Set a memory usage limit. By default, zstd uses
212 128 MiB for decompression as the maximum amount of memory the de‐
213 compressor is allowed to use, but you can override this manually if
214 need be in either direction (i.e. you can increase or decrease it).
215
216 This is also used during compression when using with --patch-from=.
217 In this case, this parameter overrides that maximum size allowed
218 for a dictionary. (128 MiB).
219
220 Additionally, this can be used to limit memory for dictionary
221 training. This parameter overrides the default limit of 2 GiB. zstd
222 will load training samples up to the memory limit and ignore the
223 rest.
224
225 ○ --stream-size=#: Sets the pledged source size of input coming from
226 a stream. This value must be exact, as it will be included in the
227 produced frame header. Incorrect stream sizes will cause an error.
228 This information will be used to better optimize compression param‐
229 eters, resulting in better and potentially faster compression, es‐
230 pecially for smaller source sizes.
231
232 ○ --size-hint=#: When handling input from a stream, zstd must guess
233 how large the source size will be when optimizing compression pa‐
234 rameters. If the stream size is relatively small, this guess may be
235 a poor one, resulting in a higher compression ratio than expected.
236 This feature allows for controlling the guess when needed. Exact
237 guesses result in better compression ratios. Overestimates result
238 in slightly degraded compression ratios, while underestimates may
239 result in significant degradation.
240
241 ○ -o FILE: save result into FILE.
242
243 ○ -f, --force: disable input and output checks. Allows overwriting
244 existing files, input from console, output to stdout, operating on
245 links, block devices, etc. During decompression and when the output
246 destination is stdout, pass-through unrecognized formats as-is.
247
248 ○ -c, --stdout: write to standard output (even if it is the console);
249 keep original files unchanged.
250
251 ○ --[no-]sparse: enable / disable sparse FS support, to make files
252 with many zeroes smaller on disk. Creating sparse files may save
253 disk space and speed up decompression by reducing the amount of
254 disk I/O. default: enabled when output is into a file, and disabled
255 when output is stdout. This setting overrides default and can force
256 sparse mode over stdout.
257
258 ○ --[no-]pass-through enable / disable passing through uncompressed
259 files as-is. During decompression when pass-through is enabled, un‐
260 recognized formats will be copied as-is from the input to the out‐
261 put. By default, pass-through will occur when the output destina‐
262 tion is stdout and the force (-f) option is set.
263
264 ○ --rm: remove source file(s) after successful compression or decom‐
265 pression. This command is silently ignored if output is stdout. If
266 used in combination with -o, triggers a confirmation prompt (which
267 can be silenced with -f), as this is a destructive operation.
268
269 ○ -k, --keep: keep source file(s) after successful compression or de‐
270 compression. This is the default behavior.
271
272 ○ -r: operate recursively on directories. It selects all files in the
273 named directory and all its subdirectories. This can be useful both
274 to reduce command line typing, and to circumvent shell expansion
275 limitations, when there are a lot of files and naming breaks the
276 maximum size of a command line.
277
278 ○ --filelist FILE read a list of files to process as content from
279 FILE. Format is compatible with ls output, with one file per line.
280
281 ○ --output-dir-flat DIR: resulting files are stored into target DIR
282 directory, instead of same directory as origin file. Be aware that
283 this command can introduce name collision issues, if multiple
284 files, from different directories, end up having the same name.
285 Collision resolution ensures first file with a given name will be
286 present in DIR, while in combination with -f, the last file will be
287 present instead.
288
289 ○ --output-dir-mirror DIR: similar to --output-dir-flat, the output
290 files are stored underneath target DIR directory, but this option
291 will replicate input directory hierarchy into output DIR.
292
293 If input directory contains "..", the files in this directory will
294 be ignored. If input directory is an absolute directory (i.e.
295 "/var/tmp/abc"), it will be stored into the "out‐
296 put-dir/var/tmp/abc". If there are multiple input files or directo‐
297 ries, name collision resolution will follow the same rules as
298 --output-dir-flat.
299
300 ○ --format=FORMAT: compress and decompress in other formats. If com‐
301 piled with support, zstd can compress to or decompress from other
302 compression algorithm formats. Possibly available options are zstd,
303 gzip, xz, lzma, and lz4. If no such format is provided, zstd is the
304 default.
305
306 ○ -h/-H, --help: display help/long help and exit
307
308 ○ -V, --version: display version number and exit. Advanced: -vV also
309 displays supported formats. -vvV also displays POSIX support. -q
310 will only display the version number, suitable for machine reading.
311
312 ○ -v, --verbose: verbose mode, display more information
313
314 ○ -q, --quiet: suppress warnings, interactivity, and notifications.
315 specify twice to suppress errors too.
316
317 ○ --no-progress: do not display the progress bar, but keep all other
318 messages.
319
320 ○ --show-default-cparams: shows the default compression parameters
321 that will be used for a particular input file, based on the pro‐
322 vided compression level and the input size. If the provided file is
323 not a regular file (e.g. a pipe), this flag will output the parame‐
324 ters used for inputs of unknown size.
325
326 ○ --: All arguments after -- are treated as files
327
328
330 Additional options for the pzstd utility
331
332 -p, --processes
333 number of threads to use for (de)compression (default:4)
334
335
336
337
338 gzip Operation Modifiers
339 When invoked via a gzip symlink, zstd will support further options that
340 intend to mimic the gzip behavior:
341
342 -n, --no-name
343 do not store the original filename and timestamps when compress‐
344 ing a file. This is the default behavior and hence a no-op.
345
346 --best alias to the option -9.
347
348 Environment Variables
349 Employing environment variables to set parameters has security implica‐
350 tions. Therefore, this avenue is intentionally limited. Only
351 ZSTD_CLEVEL and ZSTD_NBTHREADS are currently supported. They set the
352 compression level and number of threads to use during compression, re‐
353 spectively.
354
355 ZSTD_CLEVEL can be used to set the level between 1 and 19 (the "normal"
356 range). If the value of ZSTD_CLEVEL is not a valid integer, it will be
357 ignored with a warning message. ZSTD_CLEVEL just replaces the default
358 compression level (3).
359
360 ZSTD_NBTHREADS can be used to set the number of threads zstd will at‐
361 tempt to use during compression. If the value of ZSTD_NBTHREADS is not
362 a valid unsigned integer, it will be ignored with a warning message.
363 ZSTD_NBTHREADS has a default value of (1), and is capped at ZSTDMT_NB‐
364 WORKERS_MAX==200. zstd must be compiled with multithread support for
365 this to have any effect.
366
367 They can both be overridden by corresponding command line arguments: -#
368 for compression level and -T# for number of compression threads.
369
371 zstd offers dictionary compression, which greatly improves efficiency
372 on small files and messages. It´s possible to train zstd with a set of
373 samples, the result of which is saved into a file called a dictionary.
374 Then, during compression and decompression, reference the same dictio‐
375 nary, using command -D dictionaryFileName. Compression of small files
376 similar to the sample set will be greatly improved.
377
378 --train FILEs
379 Use FILEs as training set to create a dictionary. The training
380 set should ideally contain a lot of samples (> 100), and weight
381 typically 100x the target dictionary size (for example, ~10 MB
382 for a 100 KB dictionary). --train can be combined with -r to in‐
383 dicate a directory rather than listing all the files, which can
384 be useful to circumvent shell expansion limits.
385
386 Since dictionary compression is mostly effective for small
387 files, the expectation is that the training set will only con‐
388 tain small files. In the case where some samples happen to be
389 large, only the first 128 KiB of these samples will be used for
390 training.
391
392 --train supports multithreading if zstd is compiled with thread‐
393 ing support (default). Additional advanced parameters can be
394 specified with --train-fastcover. The legacy dictionary builder
395 can be accessed with --train-legacy. The slower cover dictionary
396 builder can be accessed with --train-cover. Default --train is
397 equivalent to --train-fastcover=d=8,steps=4.
398
399 -o FILE
400 Dictionary saved into FILE (default name: dictionary).
401
402 --maxdict=#
403 Limit dictionary to specified size (default: 112640 bytes). As
404 usual, quantities are expressed in bytes by default, and it´s
405 possible to employ suffixes (like KB or MB) to specify larger
406 values.
407
408 -# Use # compression level during training (optional). Will gener‐
409 ate statistics more tuned for selected compression level, re‐
410 sulting in a small compression ratio improvement for this level.
411
412 -B# Split input files into blocks of size # (default: no split)
413
414 -M#, --memory=#
415 Limit the amount of sample data loaded for training (default: 2
416 GB). Note that the default (2 GB) is also the maximum. This pa‐
417 rameter can be useful in situations where the training set size
418 is not well controlled and could be potentially very large.
419 Since speed of the training process is directly correlated to
420 the size of the training sample set, a smaller sample set leads
421 to faster training.
422
423 In situations where the training set is larger than maximum mem‐
424 ory, the CLI will randomly select samples among the available
425 ones, up to the maximum allowed memory budget. This is meant to
426 improve dictionary relevance by mitigating the potential impact
427 of clustering, such as selecting only files from the beginning
428 of a list sorted by modification date, or sorted by alphabetical
429 order. The randomization process is deterministic, so training
430 of the same list of files with the same parameters will lead to
431 the creation of the same dictionary.
432
433 --dictID=#
434 A dictionary ID is a locally unique ID. The decoder will use
435 this value to verify it is using the right dictionary. By de‐
436 fault, zstd will create a 4-bytes random number ID. It´s possi‐
437 ble to provide an explicit number ID instead. It´s up to the
438 dictionary manager to not assign twice the same ID to 2 differ‐
439 ent dictionaries. Note that short numbers have an advantage: an
440 ID < 256 will only need 1 byte in the compressed frame header,
441 and an ID < 65536 will only need 2 bytes. This compares favor‐
442 ably to 4 bytes default.
443
444 Note that RFC8878 reserves IDs less than 32768 and greater than
445 or equal to 2\^31, so they should not be used in public.
446
447 --train-cover[=k#,d=#,steps=#,split=#,shrink[=#]]
448 Select parameters for the default dictionary builder algorithm
449 named cover. If d is not specified, then it tries d = 6 and d =
450 8. If k is not specified, then it tries steps values in the
451 range [50, 2000]. If steps is not specified, then the default
452 value of 40 is used. If split is not specified or split <= 0,
453 then the default value of 100 is used. Requires that d <= k. If
454 shrink flag is not used, then the default value for shrinkDict
455 of 0 is used. If shrink is not specified, then the default value
456 for shrinkDictMaxRegression of 1 is used.
457
458 Selects segments of size k with highest score to put in the dic‐
459 tionary. The score of a segment is computed by the sum of the
460 frequencies of all the subsegments of size d. Generally d should
461 be in the range [6, 8], occasionally up to 16, but the algorithm
462 will run faster with d <= 8. Good values for k vary widely based
463 on the input data, but a safe range is [2 * d, 2000]. If split
464 is 100, all input samples are used for both training and testing
465 to find optimal d and k to build dictionary. Supports multi‐
466 threading if zstd is compiled with threading support. Having
467 shrink enabled takes a truncated dictionary of minimum size and
468 doubles in size until compression ratio of the truncated dictio‐
469 nary is at most shrinkDictMaxRegression% worse than the compres‐
470 sion ratio of the largest dictionary.
471
472 Examples:
473
474 zstd --train-cover FILEs
475
476 zstd --train-cover=k=50,d=8 FILEs
477
478 zstd --train-cover=d=8,steps=500 FILEs
479
480 zstd --train-cover=k=50 FILEs
481
482 zstd --train-cover=k=50,split=60 FILEs
483
484 zstd --train-cover=shrink FILEs
485
486 zstd --train-cover=shrink=2 FILEs
487
488 --train-fastcover[=k#,d=#,f=#,steps=#,split=#,accel=#]
489 Same as cover but with extra parameters f and accel and differ‐
490 ent default value of split If split is not specified, then it
491 tries split = 75. If f is not specified, then it tries f = 20.
492 Requires that 0 < f < 32. If accel is not specified, then it
493 tries accel = 1. Requires that 0 < accel <= 10. Requires that d
494 = 6 or d = 8.
495
496 f is log of size of array that keeps track of frequency of sub‐
497 segments of size d. The subsegment is hashed to an index in the
498 range [0,2^f - 1]. It is possible that 2 different subsegments
499 are hashed to the same index, and they are considered as the
500 same subsegment when computing frequency. Using a higher f re‐
501 duces collision but takes longer.
502
503 Examples:
504
505 zstd --train-fastcover FILEs
506
507 zstd --train-fastcover=d=8,f=15,accel=2 FILEs
508
509 --train-legacy[=selectivity=#]
510 Use legacy dictionary builder algorithm with the given dictio‐
511 nary selectivity (default: 9). The smaller the selectivity
512 value, the denser the dictionary, improving its efficiency but
513 reducing its achievable maximum size. --train-legacy=s=# is also
514 accepted.
515
516 Examples:
517
518 zstd --train-legacy FILEs
519
520 zstd --train-legacy=selectivity=8 FILEs
521
523 -b# benchmark file(s) using compression level #
524
525 -e# benchmark file(s) using multiple compression levels, from -b# to
526 -e# (inclusive)
527
528 -i# minimum evaluation time, in seconds (default: 3s), benchmark
529 mode only
530
531 -B#, --block-size=#
532 cut file(s) into independent chunks of size # (default: no
533 chunking)
534
535 --priority=rt
536 set process priority to real-time
537
538 Output Format: CompressionLevel#Filename: InputSize -> OutputSize (Com‐
539 pressionRatio), CompressionSpeed, DecompressionSpeed
540
541 Methodology: For both compression and decompression speed, the entire
542 input is compressed/decompressed in-memory to measure speed. A run
543 lasts at least 1 sec, so when files are small, they are compressed/de‐
544 compressed several times per run, in order to improve measurement accu‐
545 racy.
546
548 ### -B#: Specify the size of each compression job. This parameter is
549 only available when multi-threading is enabled. Each compression job is
550 run in parallel, so this value indirectly impacts the nb of active
551 threads. Default job size varies depending on compression level (gener‐
552 ally 4 * windowSize). -B# makes it possible to manually select a custom
553 size. Note that job size must respect a minimum value which is enforced
554 transparently. This minimum is either 512 KB, or overlapSize, whichever
555 is largest. Different job sizes will lead to non-identical compressed
556 frames.
557
558 --zstd[=options]:
559 zstd provides 22 predefined regular compression levels plus the fast
560 levels. This compression level is translated internally into a number
561 of specific parameters that actually control the behavior of the com‐
562 pressor. (You can see the result of this translation with --show-de‐
563 fault-cparams.) These specific parameters can be overridden with ad‐
564 vanced compression options. The options are provided as a comma-sepa‐
565 rated list. You may specify only the options you want to change and the
566 rest will be taken from the selected or default compression level. The
567 list of available options:
568
569 strategy=strat, strat=strat
570 Specify a strategy used by a match finder.
571
572 There are 9 strategies numbered from 1 to 9, from fastest to
573 strongest: 1=ZSTD_fast, 2=ZSTD_dfast, 3=ZSTD_greedy,
574 4=ZSTD_lazy, 5=ZSTD_lazy2, 6=ZSTD_btlazy2, 7=ZSTD_btopt,
575 8=ZSTD_btultra, 9=ZSTD_btultra2.
576
577 windowLog=wlog, wlog=wlog
578 Specify the maximum number of bits for a match distance.
579
580 The higher number of increases the chance to find a match which
581 usually improves compression ratio. It also increases memory re‐
582 quirements for the compressor and decompressor. The minimum wlog
583 is 10 (1 KiB) and the maximum is 30 (1 GiB) on 32-bit platforms
584 and 31 (2 GiB) on 64-bit platforms.
585
586 Note: If windowLog is set to larger than 27, --long=windowLog or
587 --memory=windowSize needs to be passed to the decompressor.
588
589 hashLog=hlog, hlog=hlog
590 Specify the maximum number of bits for a hash table.
591
592 Bigger hash tables cause fewer collisions which usually makes
593 compression faster, but requires more memory during compression.
594
595 The minimum hlog is 6 (64 entries / 256 B) and the maximum is 30
596 (1B entries / 4 GiB).
597
598 chainLog=clog, clog=clog
599 Specify the maximum number of bits for the secondary search
600 structure, whose form depends on the selected strategy.
601
602 Higher numbers of bits increases the chance to find a match
603 which usually improves compression ratio. It also slows down
604 compression speed and increases memory requirements for compres‐
605 sion. This option is ignored for the ZSTD_fast strategy, which
606 only has the primary hash table.
607
608 The minimum clog is 6 (64 entries / 256 B) and the maximum is 29
609 (512M entries / 2 GiB) on 32-bit platforms and 30 (1B entries /
610 4 GiB) on 64-bit platforms.
611
612 searchLog=slog, slog=slog
613 Specify the maximum number of searches in a hash chain or a bi‐
614 nary tree using logarithmic scale.
615
616 More searches increases the chance to find a match which usually
617 increases compression ratio but decreases compression speed.
618
619 The minimum slog is 1 and the maximum is ´windowLog´ - 1.
620
621 minMatch=mml, mml=mml
622 Specify the minimum searched length of a match in a hash table.
623
624 Larger search lengths usually decrease compression ratio but im‐
625 prove decompression speed.
626
627 The minimum mml is 3 and the maximum is 7.
628
629 targetLength=tlen, tlen=tlen
630 The impact of this field vary depending on selected strategy.
631
632 For ZSTD_btopt, ZSTD_btultra and ZSTD_btultra2, it specifies the
633 minimum match length that causes match finder to stop searching.
634 A larger targetLength usually improves compression ratio but de‐
635 creases compression speed.
636
637 For ZSTD_fast, it triggers ultra-fast mode when > 0. The value
638 represents the amount of data skipped between match sampling.
639 Impact is reversed: a larger targetLength increases compression
640 speed but decreases compression ratio.
641
642 For all other strategies, this field has no impact.
643
644 The minimum tlen is 0 and the maximum is 128 KiB.
645
646 overlapLog=ovlog, ovlog=ovlog
647 Determine overlapSize, amount of data reloaded from previous
648 job. This parameter is only available when multithreading is en‐
649 abled. Reloading more data improves compression ratio, but de‐
650 creases speed.
651
652 The minimum ovlog is 0, and the maximum is 9. 1 means "no over‐
653 lap", hence completely independent jobs. 9 means "full overlap",
654 meaning up to windowSize is reloaded from previous job. Reducing
655 ovlog by 1 reduces the reloaded amount by a factor 2. For exam‐
656 ple, 8 means "windowSize/2", and 6 means "windowSize/8". Value 0
657 is special and means "default": ovlog is automatically deter‐
658 mined by zstd. In which case, ovlog will range from 6 to 9, de‐
659 pending on selected strat.
660
661 ldmHashLog=lhlog, lhlog=lhlog
662 Specify the maximum size for a hash table used for long distance
663 matching.
664
665 This option is ignored unless long distance matching is enabled.
666
667 Bigger hash tables usually improve compression ratio at the ex‐
668 pense of more memory during compression and a decrease in com‐
669 pression speed.
670
671 The minimum lhlog is 6 and the maximum is 30 (default: 20).
672
673 ldmMinMatch=lmml, lmml=lmml
674 Specify the minimum searched length of a match for long distance
675 matching.
676
677 This option is ignored unless long distance matching is enabled.
678
679 Larger/very small values usually decrease compression ratio.
680
681 The minimum lmml is 4 and the maximum is 4096 (default: 64).
682
683 ldmBucketSizeLog=lblog, lblog=lblog
684 Specify the size of each bucket for the hash table used for long
685 distance matching.
686
687 This option is ignored unless long distance matching is enabled.
688
689 Larger bucket sizes improve collision resolution but decrease
690 compression speed.
691
692 The minimum lblog is 1 and the maximum is 8 (default: 3).
693
694 ldmHashRateLog=lhrlog, lhrlog=lhrlog
695 Specify the frequency of inserting entries into the long dis‐
696 tance matching hash table.
697
698 This option is ignored unless long distance matching is enabled.
699
700 Larger values will improve compression speed. Deviating far from
701 the default value will likely result in a decrease in compres‐
702 sion ratio.
703
704 The default value is wlog - lhlog.
705
706 Example
707 The following parameters sets advanced compression options to something
708 similar to predefined level 19 for files bigger than 256 KB:
709
710 --zstd=wlog=23,clog=23,hlog=22,slog=6,mml=3,tlen=48,strat=6
711
713 zstdgrep(1), zstdless(1), gzip(1), xz(1)
714
715 The zstandard format is specified in Y. Collet, "Zstandard Compression
716 and the ´application/zstd´ Media Type",
717 https://www.ietf.org/rfc/rfc8878.txt, Internet RFC 8878 (February
718 2021).
719
721 Report bugs at: https://github.com/facebook/zstd/issues
722
724 Yann Collet
725
726
727
728zstd 1.5.5 March 2023 ZSTD(1)