Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compression of zstd archive type more similar to zstdcli #354

Merged
merged 3 commits into from Sep 17, 2023

Conversation

sebres
Copy link
Contributor

@sebres sebres commented Sep 14, 2023

This PR sets several parameters to zstd compression that forces it to work more similar to standard zstd client + few small fixes:

  • set source size as hint if it is known e. g. by file compression (slightly better performance and/or compression ratio);
    although the feature still calling as "experimental", but zstd uses this in its own client since v.1.4 IIRC and the only known drawback would be significant regress of compression ratio if guess considerably underestimates, but it does no matter in case of known file size.

  • make compression of zstd archive type more similar to Zstandard CLI (store dictID and checksum by default in zstd type); this has no effect for 7z archive type with zstd method

  • brotli: small amend that avoid setting of size hint if -si specified (size is unknown)

After all 7z would create almost the same compressed data as standard zstd-cli (can deviate by 1-2 bytes in header).

…le compression (slightly better performance and/or compression ratio);

although the feature still calling as "experimental", but zstd uses this in its own client since v.1.4 IIRC and the only known drawback would be significant regress of compression ration if guess considerably underestimates, but it does no matter in case of known file size.
…store dictID and checksum by default in zstd type, no effect for 7z type)
…e unpackSize will be supplied as -1 (`UINT64_MAX`)
@mcmilk mcmilk merged commit ce27b4a into mcmilk:master Sep 17, 2023
6 checks passed
@sebres sebres deleted the zstd-like-zstdcli--sizehint-checksum branch September 19, 2023 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants