Skip to content

Conversation

Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented May 4, 2021

answer #2043 .
previous lower limit was 1 MB.

Note : by default, the smallest job size, achieved at level 1, is 2 MB.
So this PR has no impact on multi-threading compression at default settings.
Smaller job sizes can be achieved by manipulating job sizes directly,
or by manually modifying window sizes to lower amounts.

#2043 requested to make the minimum modifiable at runtime,
but it doesn't make sense, since jobSize itself is a runtime parameter.
If there is a lower limit, that's because we believe there are side effects introduced when job sizes are too small, and they should be avoided. The value of the lower limit can be negotiated, but its existence should not.

Minimum job size can still be modified at compile time, setting build variable ZSTDMT_JOBSIZE_MIN.
This makes it practical for tests, in trying to assess what's a better minimum on a specific system.

Also : updated unit test to ensure that this new limit works fine
(test would fail with previous 1 MB limit).

previous lower limit was 1 MB.

Note : by default, the lowest job size is 2 MB, achieved at level 1.
Even lower job sizes can be achieved by manipulating this value directly,
or manually modifying window sizes to lower amounts.

Updated unit test to ensure that this new limit works fine
(test would fail with previous 1 MB limit).
@terrelln
Copy link
Contributor

terrelln commented May 4, 2021

Looks like this needs to be fixed:

U32 const jobSizeMB = (U32)(mtctx->targetSectionSize >> 20);
U32 const rsyncBits = ZSTD_highbit32(jobSizeMB) + 20;
assert(jobSizeMB >= 1);

IDK why it converts job size to MB, but it seems like it could just be:

 U32 const rsyncBits = ZSTD_highbit32(mtctx->targetSectionSize);

@Cyan4973 Cyan4973 merged commit c077f25 into dev May 5, 2021
@Cyan4973 Cyan4973 deleted the smallerJobs branch December 9, 2021 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants