Repository navigation
Conversation
…mode - -T# default is ZSTDCLI_NBTHREADS_DEFAULT, based on logical cores (UTIL_countLogicalCores() / 4, since meta#4211), not physical cores. - ZSTDMT_NBWORKERS_MAX is 64 on 32-bit and 256 on 64-bit, not 200. - Benchmark mode uses 1 worker thread by default since 725a152. Signed-off-by: YoungjuKim <fjvbn2003@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Three statements about default thread counts in
programs/zstd.1.md(and the generatedprograms/zstd.1) no longer match the code ondev:-T#says the default is "between 1 and 4 depending on physical CPU cores". The default isZSTDCLI_NBTHREADS_DEFAULT, which isMAX(1, MIN(4, UTIL_countLogicalCores() / 4))(programs/zstdcli.c, introduced in Change CLI to employ multithreading by default #4211). On an 8-core/16-thread machine this gives 4 threads, not 2. (Only-T0uses physical cores by default, via--auto-threads=physical, and the man page already says so.)ZSTD_NBTHREADSparagraph says the value "is capped at ZSTDMT_NBWORKERS_MAX==200".ZSTDMT_NBWORKERS_MAXis 64 on 32-bit and 256 on 64-bit (lib/compress/zstdmt_compress.h), which is also what the-T#paragraph of the same page says.max(1, min(4, nbCores/4))worker threads by default. Since 725a152 ("benchmark uses 1 thread by default"),zstdcli.csetsnbWorkers = 1in bench mode when-T#is not given. (v1.5.7 still used the formula, so this only affects the next release.)This PR updates the three sentences in
zstd.1.mdand the matching lines inzstd.1, in the same way #4474 did.How I checked: I read
programs/zstdcli.candlib/compress/zstdmt_compress.hondev, and found the commits throughgit log. With zstd v1.5.7 on a 10-core machine,zstd -vvvvreportsCompressing with 2 worker threads(10/4 = 2) and-b1reportsusing 2 threads, which matches the v1.5.7 code. I did not builddev. On this machine the physical and logical core counts are both 10, so the physical/logical difference in point 1 comes from reading the source, not from a run.Checklist
Tools used
An AI assistant (Claude) helped compare the man page with the source and draft the wording. I reviewed and checked every change against the code.
🤖 Generated with Claude Code