Zstandard.Native.osx-arm64
1.0.0
dotnet add package Zstandard.Native.osx-arm64 --version 1.0.0
NuGet\Install-Package Zstandard.Native.osx-arm64 -Version 1.0.0
<PackageReference Include="Zstandard.Native.osx-arm64" Version="1.0.0" />
<PackageVersion Include="Zstandard.Native.osx-arm64" Version="1.0.0" />
<PackageReference Include="Zstandard.Native.osx-arm64" />
paket add Zstandard.Native.osx-arm64 --version 1.0.0
#r "nuget: Zstandard.Native.osx-arm64, 1.0.0"
#:package Zstandard.Native.osx-arm64@1.0.0
#addin nuget:?package=Zstandard.Native.osx-arm64&version=1.0.0
#tool nuget:?package=Zstandard.Native.osx-arm64&version=1.0.0
Zstandard.Native
Ultra-fast Native AOT-safe Zstandard wrapper for .NET 8, .NET 9, and .NET 10 — zero-allocation Span<byte> APIs, source-generated [LibraryImport] P/Invoke, and hardware-accelerated buffer paths via AVX-512 / AVX10.2 and ARM64 SVE.
Install
dotnet add package Zstandard.Native
You also need a libzstd binary on the loader path. See Native runtime binaries for options (companion runtime package, bring-your-own, or system package manager).
Quick start
One-shot compress / decompress
using Zstandard.Native;
ReadOnlySpan<byte> src = File.ReadAllBytes("data.bin");
byte[] compressed = new byte[ZstdCompressor.GetCompressBound(src.Length)];
int n = ZstdCompressor.Compress(src, compressed, compressionLevel: 3);
byte[] back = new byte[src.Length];
ZstdCompressor.Decompress(compressed.AsSpan(0, n), back);
Streaming with context reuse
using var compressor = new ZstdStreamCompressor(compressionLevel: 3);
Span<byte> outBuf = stackalloc byte[ZstdStreamCompressor.RecommendedOutputSize];
foreach (var frame in frames)
{
compressor.Reset(); // reuses ZSTD_CCtx — no allocation
var r = compressor.Compress(frame.Span, outBuf, ZstdEndDirective.End);
sink.Write(outBuf[..r.BytesWritten]);
}
Features
- Zero allocations on the hot path —
Span<byte>-only public API - Native AOT compatible — every
IL2xxx/IL3xxxwarning is an error in CI; no reflection, no marshalling shims SafeHandlelifetime management forZSTD_CCtx/ZSTD_DCtx— finalizer-safe even on process abort- Streaming with
Reset()context reuse — skipsZSTD_createCCtxper frame - Hardware acceleration via
Vector512(AVX-512 / AVX10.2) and SVE (ARM64 variable-width) for buffer scrub operations - Targets libzstd ≥ 1.5.0 on
win-x64,win-arm64,linux-x64,linux-arm64,osx-x64,osx-arm64
Performance highlights
| Scenario | Runtime | Throughput | Allocated |
|---|---|---|---|
| Stream compress, context reuse, 1 MiB | NativeAOT 10.0 | 12 510 MB/s | 0 B |
| Stream compress, context reuse, 64 KB | NativeAOT 10.0 | 12 015 MB/s | 0 B |
| One-shot compress vs ZstdSharp, 64 KB level 3 | AOT 10.0 | +37% faster | 0 B vs 64 B |
| One-shot compress vs ZstdSharp, 1 MiB level 1 | AOT 10.0 | +37% faster | 0 B vs 65 B |
Links
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Zstandard.Native.osx-arm64:
| Package | Downloads |
|---|---|
|
Zstandard.Native.Runtimes
Meta-package that pulls in all per-RID Zstandard.Native runtime binaries. Add alongside Zstandard.Native for automatic binary resolution on all supported platforms. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 44 | 5/30/2026 |
| 1.0.0-rc.1 | 42 | 5/26/2026 |
| 0.2.0-rc.2 | 40 | 5/26/2026 |