util/compression: use zstd.EncoderLevelFromZstd to map compression levels#6933
Open
thaJeztah wants to merge 1 commit into
Open
util/compression: use zstd.EncoderLevelFromZstd to map compression levels#6933thaJeztah wants to merge 1 commit into
thaJeztah wants to merge 1 commit into
Conversation
Member
Author
|
Test failure output looks a bit wonky; for some reason it does print Lines 1175 to 1189 in 64bbec8 |
Member
Author
|
From discussion on Slack to see if there was anything to match w.r.t. behavior, but looks like containerd at least does not set any options at all, so always uses the defaults; https://github.com/containerd/containerd/blob/d8f13bf4cce8b8a99ae61457cb574696fcf475e5/pkg/archive/compression/compression.go#L244-L256 |
2 tasks
…vels The toZstdEncoderLevel utility was introduced in cab33b1, and has a custom mapping of zstd compressions levels to their go (klauspost/compress) counterparts. Swap our local implementation for the one in klauspost/compress so that new levels implemented in klauspost/compress will also be mapped if they arrive. This does change some mappings; | Input level | Before | After | |-------------|------------------------|--------------------------| | `< 0` | `SpeedDefault` | `SpeedFastest` | | `6` | `SpeedDefault` | `SpeedBetterCompression` | | `9` | `SpeedBestCompression` | `SpeedBetterCompression` | While updating, also slightly refactor; - use an options slice to skip setting the option if no config was set, and to allow adding additional options. - inline zstdWriter where used, as it was only used in a single place. Signed-off-by: Sebastiaan van Stijn <[email protected]>
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.
The toZstdEncoderLevel utility was introduced in cab33b1, and has a custom mapping of zstd compressions levels to their go (klauspost/compress) counterparts.
Swap our local implementation for the one in klauspost/compress so that new levels implemented in klauspost/compress will also be mapped if they arrive.
This does change some mappings;
< 0SpeedDefaultSpeedFastest6SpeedDefaultSpeedBetterCompression9SpeedBestCompressionSpeedBetterCompressionWhile updating, also slightly refactor;