zlib-ng/zlib-ng
Freezlib replacement with optimizations for "next generation" systems.
FreeFree tier
About zlib-ng/zlib-ng
zlib-ng is a zlib-compatible data compression library that offers significant performance improvements for modern hardware. It is a community-maintained fork of zlib, featuring optimized algorithms leveraging CPU intrinsics such as SSE, AVX, NEON, and others. The library supports dual-linking, provides a modernized native API, and includes deflate medium and quick algorithms based on Intel's zlib fork. With a clean C11 codebase, it achieves up to 4x faster compression on x86-64 compared to stock zlib, making it a drop-in upgrade for applications that require high-speed compression.
Key Features
Zlib compatible API with support for dual-linking
Modernized native API based on zlib API for ease of porting
Major speed improvements (up to 4x on x86-64 compared to stock zlib)
Modern C11 syntax and clean code layout
Deflate medium and quick algorithms based on Intel’s zlib fork
Support for CPU intrinsics when available
Adler32 implementation using SSSE3, SSE4.2, AVX2, AVX512, AVX512-VNNI, Neon, Neon(DotProd), VMX VSX, LSX, LASX, RVV
CRC32-B implementation using SSE2, SSE4.1, (V)PCLMULQDQ, ARMv8, ARMv8.2 PMULL+EOR3, Power8, IBM Z, LoongArch, ZBC
Slide hash implementations using SSE2, AVX2, ARMv6
Multi-architecture support (x86, ARM, Power, LoongArch, etc.)
Pros & Cons
Pros
- Zlib compatible API enables easy integration as a drop-in replacement
- Significant speed improvements over stock zlib (up to 4x on x86-64)
- Support for a wide range of CPU intrinsics optimizes performance on modern processors
- Modern C11 codebase with clean layout and active community maintenance
- Open source under permissive license
Cons
- Optimizations target modern systems; older hardware may see less benefit
- Requires compilation and integration into build systems (no pre-built binaries provided)
Best For
Replacing zlib in existing applications for better compression speedHigh-performance data compression in cloud services and serversEmbedded systems with modern CPUs requiring efficient compressionCross-platform library for compressing files and network streams