Compare Blake3 managed vs native performance
masterBlake3.NET provides two primary implementations for hashing:
Blake3: A fully managed implementation. It is easy to deploy as it does not require shipping or loading native libraries. It delivers near-native performance, typically ranging from 11% faster to 22% slower than the native version depending on input size and architecture.Blake3.Native: A wrapper around the SIMD-optimized official Rust implementation. This is generally faster for larger inputs but requires native interop.
Performance Characteristics:
- Small inputs: The managed
Blake3can occasionally outperformBlake3.Nativeon very small inputs (e.g., 4-byte or 100-byte inputs on certain architectures). - Large inputs:
Blake3.Nativetypically maintains a performance advantage (roughly 12% to 22% faster on x64) as input size increases. - Allocations: Both serial implementations (
Blake3andBlake3.Native) complete without managed allocations.