From 19ffcf81b88909f28757d7d367696d298f2c5e46 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 4 Mar 2025 13:17:10 -0800 Subject: [PATCH] changed -B# command into --jobsize to reduce confusion with the term "block". -B# remains supported for existing scripts, but it's no longer documented, so it's effectively a hidden shortcut. --- programs/zstd.1.md | 8 ++++---- programs/zstdcli.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/zstd.1.md b/programs/zstd.1.md index 3b7bc342a..cf1810d59 100644 --- a/programs/zstd.1.md +++ b/programs/zstd.1.md @@ -503,12 +503,12 @@ similar to predefined level 19 for files bigger than 256 KB: `--zstd`=wlog=23,clog=23,hlog=22,slog=6,mml=3,tlen=48,strat=6 -### -B#: +### --jobsize=#: Specify the size of each compression job. -This parameter is only available when multi-threading is enabled. -Each compression job is run in parallel, so this value indirectly impacts the nb of active threads. +This parameter is only meaningful when multi-threading is enabled. +Each compression job is run in parallel, so this value can indirectly impact the nb of active threads. Default job size varies depending on compression level (generally `4 * windowSize`). -`-B#` makes it possible to manually select a custom size. +`--jobsize=#` makes it possible to manually select a custom size. Note that job size must respect a minimum value which is enforced transparently. This minimum is either 512 KB, or `overlapSize`, whichever is largest. Different job sizes will lead to non-identical compressed frames. diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 7395e9585..4b7f496d0 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -1084,6 +1084,7 @@ int main(int argCount, const char* argv[]) if (longCommandWArg(&argument, "--memlimit-decompress")) { NEXT_UINT32(memLimit); continue; } if (longCommandWArg(&argument, "--block-size")) { NEXT_TSIZE(chunkSize); continue; } /* hidden command, prefer --split below */ if (longCommandWArg(&argument, "--split")) { NEXT_TSIZE(chunkSize); continue; } + if (longCommandWArg(&argument, "--jobsize")) { NEXT_TSIZE(chunkSize); continue; } /* note: overloaded variable */ if (longCommandWArg(&argument, "--maxdict")) { NEXT_UINT32(maxDictSize); continue; } if (longCommandWArg(&argument, "--dictID")) { NEXT_UINT32(dictID); continue; } if (longCommandWArg(&argument, "--zstd=")) { if (!parseCompressionParameters(argument, &compressionParams)) { badUsage(programName, originalArgument); CLEAN_RETURN(1); } ; cType = FIO_zstdCompression; continue; } @@ -1266,7 +1267,7 @@ int main(int argCount, const char* argv[]) bench_nbSeconds = readU32FromChar(&argument); break; - /* cut input into independent chunks (benchmark only) */ + /* hidden shortcut for --split=# and --jobsize=# */ case 'B': argument++; chunkSize = readU32FromChar(&argument);