Repository navigation
v0.1.0
·
147 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Zstandard and LZ4 for .NET, in 100 % managed C#. No native binary, no P/Invoke, Native AOT ready, and the same bytes as the reference libraries.
dotnet add package ManagedCompressions.Zstd
dotnet add package ManagedCompressions.Lz4✨ Highlights
- ⚡ Faster than native at decompression: Zstandard decodes up to 1.5× as fast as libzstd.
- 🎯 Byte-identical output: every frame and block is the one libzstd 1.5.7 or lz4 1.10.0 writes, at every level, so the ratios are theirs.
- 🚀 Native AOT and trimming: no reflection, no dynamic code, no analyzer warning, and the same speed as under the JIT.
- ♻️ Zero allocation per call once warm.
📊 Speed against native
silesia.tar, one thread, JIT and Native AOT. Above 1.00× is faster than native.
| Apple M4 Pro (arm64) | Ryzen 9 7950X (x64) | |
|---|---|---|
| Zstd decompression | 1.30 – 1.49× | 1.01 – 1.11× |
| Zstd compression | 0.94 – 1.03× | 0.92 – 1.09× |
| LZ4 decompression | 1.03 – 1.04× | 0.99 – 1.08× |
| LZ4 compression | 0.85 – 0.96× | 0.88 – 0.95× |
📦 Packages
ManagedCompressions.Zstd |
Zstandard (RFC 8878): levels -131072 to 22, dictionaries, checksums, multithreaded CompressAsync |
ManagedCompressions.Lz4 |
LZ4 block format (Parquet's LZ4_RAW), every level up to HC 12 |
Note
Requires .NET 11. No streaming API: one call per frame or block, in memory, up to 2 GiB.
Full benchmarks and methodology in the README.