From 64c4288e9272c7b65f381d456e70eec35fc3cfd3 Mon Sep 17 00:00:00 2001 From: Jamie Lokier Date: Tue, 2 Sep 2025 16:44:09 +0100 Subject: [PATCH] Update manual about the default value of `-T#`/`--threads=#` The section about `ZSTD_NBTHREADS` already explains the default number of threads, since it changed from 1 (commit 17beeb5). But the option description for `-T#`/`--threads=#` incorrectly said the default was still 1. I noticed this when I found compression slower with `-T1` than without it. --- programs/zstd.1 | 2 +- programs/zstd.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/zstd.1 b/programs/zstd.1 index 5503a5b86..e49a182d5 100644 --- a/programs/zstd.1 +++ b/programs/zstd.1 @@ -108,7 +108,7 @@ Display information related to a zstd compressed file, such as size, ratio, and \fB\-\-fast[=#]\fR: switch to ultra\-fast compression levels\. If \fB=#\fR is not present, it defaults to \fB1\fR\. The higher the value, the faster the compression speed, at the cost of some compression ratio\. This setting overwrites compression level if one was set previously\. Similarly, if a compression level is set after \fB\-\-fast\fR, it overrides it\. . .IP "\(bu" 4 -\fB\-T#\fR, \fB\-\-threads=#\fR: Compress using \fB#\fR working threads (default: 1)\. If \fB#\fR is 0, attempt to detect and use the number of physical CPU cores\. In all cases, the nb of threads is capped to \fBZSTDMT_NBWORKERS_MAX\fR, which is either 64 in 32\-bit mode, or 256 for 64\-bit environments\. This modifier does nothing if \fBzstd\fR is compiled without multithread support\. +\fB\-T#\fR, \fB\-\-threads=#\fR: Compress using \fB#\fR working threads (default: between 1 and 4 depending on physical CPU cores; see \fBZSTD_NBTHREADS\fR below)\. If \fB#\fR is 0, attempt to detect and use the number of physical CPU cores\. In all cases, the nb of threads is capped to \fBZSTDMT_NBWORKERS_MAX\fR, which is either 64 in 32\-bit mode, or 256 for 64\-bit environments\. This modifier does nothing if \fBzstd\fR is compiled without multithread support\. . .IP "\(bu" 4 \fB\-\-single\-thread\fR: Use a single thread for both I/O and compression\. As compression is serialized with I/O, this can be slightly slower\. Single\-thread mode features significantly lower memory usage, which can be useful for systems with limited amount of memory, such as 32\-bit systems\. diff --git a/programs/zstd.1.md b/programs/zstd.1.md index cf1810d59..bb9258d57 100644 --- a/programs/zstd.1.md +++ b/programs/zstd.1.md @@ -126,7 +126,7 @@ the last one takes effect. This setting overwrites compression level if one was set previously. Similarly, if a compression level is set after `--fast`, it overrides it. * `-T#`, `--threads=#`: - Compress using `#` working threads (default: 1). + Compress using `#` working threads (default: between 1 and 4 depending on physical CPU cores; see `ZSTD_NBTHREADS` below). If `#` is 0, attempt to detect and use the number of physical CPU cores. In all cases, the nb of threads is capped to `ZSTDMT_NBWORKERS_MAX`, which is either 64 in 32-bit mode, or 256 for 64-bit environments.