Repository navigation
Conversation
Experiment, not for merging as is: the SBOM script, README and license files still describe the C decoder.
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.
Experiment: replaces the vendored C zstd with zrip's pure Rust decoder (
zrip-core+zrip-decode, both#![forbid(unsafe_code)], vendored innative/vendorso the offline Linux build keeps working). Opened as a draft for reference and to get CI builds on every platform, not meant to be merged.Conclusion: not worth it for now. Performance is about on par with C zstd, but the binary gets ~30% bigger compressed, and C zstd is well proven and safe enough as used here, so swapping it out doesn't buy much.
Size (Linux aarch64, measured locally)
szrip's decoder compiles to ~126KB of code vs ~58KB for C zstd, mostly a few heavily inlined functions.
Speed
Pure in-memory decoding is on par with C zstd. Extracting whole archives through the binary (best of 25 runs, ±10% noise): phpstan +0-12%, aws about equal, google/apiclient-services (many small files) +8-13% and 161MB peak memory vs 128MB, due to how the streaming decoder stages blocks.
Correctness
Not done
The SBOM script, README, license files (zrip is MIT; keeping the zstd BSD notice would be prudent as parts are ported from C zstd) and the committed binaries are not updated, so the SBOM and binary comparison checks are expected to fail.