GrindCore.net provides a unified managed interface for a wide variety of high-performance native compression algorithms. These algorithms are compiled from source within the GrindCore Native project to ensure platform-specific optimization and byte-perfect deterministic output README.md72-83
The library supports two primary modes of operation for every algorithm:
Stream implementation for sequential data processing README.md58-61All implementations follow a strict inheritance pattern to ensure consistency across the API.
| Mode | Base Class | Primary Purpose |
|---|---|---|
| Stream | CompressionStream | Sequential read/write with advanced buffer management and position correction README.md61 |
| Block | CompressionBlock | Direct memory-to-memory compression/decompression without stream overhead README.md62 |
GrindCore includes "Ng" (Next Generation) variants for the ZLib family (Deflate, GZip, ZLib). These variants utilize zlib-ng (v2.2.1), a fork optimized for modern CPU instructions (SSE, AVX, NEON), offering significantly higher performance than the classic zlib (v1.3.1) implementation README.md80-81
The following diagram illustrates how the natural language algorithm names map to the core internal entities and their respective native interop layers.
Algorithm Entity Mapping
Sources: README.md54-67 src/Brotli/BrotliEncoder.cs11-18 src/Brotli/BrotliDecoder.cs11-13
Includes both standard zlib (v1.3.1) and zlib-ng (v2.2.1). This family supports the three common header formats: raw Deflate, GZip (with CRC32), and ZLib (with Adler32) README.md80-81
Based on Brotli v1.1.0. It is highly optimized for web content and provides a competitive alternative to ZLib for static assets README.md74 The implementation uses BrotliEncoder and BrotliDecoder structs for low-allocation processing src/Brotli/BrotliEncoder.cs11 src/Brotli/BrotliDecoder.cs11
Implementations based on 7-Zip v25.1.0. LZMA2 is the modern successor, offering better multi-threading support and handling of non-compressible data README.md77-78
A high-speed LZMA2 variant (v1.0.1) from the 7Zip-mcmilk fork, designed for significantly faster compression speeds while maintaining LZMA2 compatibility README.md79
Based on LZ4 v1.10.0. This algorithm prioritizes speed over compression ratio. Note: LZ4 implementation in GrindCore is currently constrained to 64-bit architectures README.md76 tests/GrindCore.Tests/CompressionStreamTests.cs28-29
Supports both v1.5.2 and v1.5.7 to maintain compatibility with legacy pinned data. ZStd offers a highly tunable balance between speed and compression ratio README.md82
A specialized implementation that performs no compression. It is used primarily for testing, benchmarking, or as a fallback when compression is disabled by configuration README.md75
GrindCore allows developers to pin specific versions of algorithms via the CompressionVersion system to ensure that compressed output remains byte-identical across library updates. This is critical for applications requiring deterministic, byte-perfect outputs README.md85
Version Dispatching Logic
Sources: src/Brotli/BrotliEncoder.cs34-40 src/Brotli/BrotliDecoder.cs24-30
Sources:
Refresh this wiki