-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Implement ZStandard Stream, Encoder, Decoder #119575
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements ZStandard stream, encoder, and decoder functionality for .NET by integrating the zstd native library. The changes primarily consist of adding the external zstd library source files and build infrastructure to support compression and decompression capabilities.
Key Changes:
- Integration of zstd native library source code (version metadata suggests 0.9.0)
- Build system configuration files for Meson and CMake
- Single-file library generation scripts and examples
- Test infrastructure for the zstd implementation
Reviewed Changes
Copilot reviewed 142 out of 237 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/external/zstd/lib/common/fse_decompress.c | FSE (Finite State Entropy) decompression implementation |
| src/native/external/zstd/lib/common/fse.h | FSE codec public API and data structures |
| src/native/external/zstd/lib/common/error_private.h | Internal error handling macros and definitions |
| src/native/external/zstd/lib/common/error_private.c | Error code to string mapping implementation |
| src/native/external/zstd/lib/common/entropy_common.c | Common entropy encoding/decoding functions |
| src/native/external/zstd/lib/common/debug.h | Debug logging and assertion macros |
| src/native/external/zstd/lib/common/debug.c | Debug level global variable definition |
| src/native/external/zstd/lib/common/cpu.h | CPU feature detection (BMI2, AVX, etc.) |
| src/native/external/zstd/lib/common/compiler.h | Compiler-specific macros and attributes |
| src/native/external/zstd/lib/common/bitstream.h | Bitstream encoding/decoding utilities |
| src/native/external/zstd/lib/common/bits.h | Bit manipulation helper functions |
| src/native/external/zstd/lib/common/allocations.h | Custom memory allocation wrappers |
| src/native/external/zstd/lib/README.md | Documentation for library structure and build options |
| src/native/external/zstd/lib/Makefile | Build configuration for the zstd library |
| src/native/external/zstd/lib/BUCK | Buck build system configuration |
| src/native/external/zstd/lib/.gitignore | Git ignore rules for build artifacts |
| src/native/external/zstd/build/single_file_libs/* | Scripts and examples for single-file library generation |
| src/native/external/zstd/build/meson/* | Meson build system configuration files |
| src/native/external/zstd/build/cmake/tests/.gitignore | Git ignore rules for CMake test artifacts |
|
I think this PR is ready for the first round of reviews |
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
|
Well, retargeting required a bit of a dance, but hopefully everything went well, this PR now contains only the work that needs to be reviewed (minus a couple of zstd patches taken from their upstream to get around build errors) |
Implements #59591
There are some patches applied to vendored zstd sources which are listed in src/native/zstd-version.txt, neither of them should be necessary once we update to next release (maintainers didn't commit to a release date, but hopefully they will release something early next year).
Benchmarks results (taken from dotnet/performance repo) look great so far
Benchmark results