The release of the zlib-ng 2.0 library marks the first stable release of the project (followed by the corrective release 2.0.1). Zlib-ng is API-compatible with zlib but provides additional optimizations that were not accepted into the official zlib repository due to a conservative approach to incorporating changes. Additionally, a modernized API, based on zlib but modified for easier porting, is offered. The project's code is written in C and is distributed under the Zlib license.
Tests conducted on x86_64 systems showed that during compression operations, zlib-ng is approximately 4 times faster than zlib and 2.1 times faster than gzip. During decompression, zlib-ng is about 2.4 times faster than zlib and 1.8 times faster than gzip. Significant improvements in compression/decompression performance were primarily achieved by leveraging vector instructions such as SSE*, AVX2, VSX, and Neon.
This includes an implementation of the Adler32 checksum algorithm, optimized using SSSE3, AVX2, Neon, and VSX instructions, a CRC32-B implementation based on PCLMULQDQ and ACLE, improved hash tables, a Slide hash implementation utilizing SSE2, AVX2, Neon, and VSX, and comparison operations based on SSE4.2 and AVX2. The package also includes performance-enhancing modifications used in forks by Intel and Cloudflare. The buffering process has been optimized. Support for build systems CMake and NMake has been added. Continuous integration systems were used for testing.
In addition to optimizations, Zlib-ng also includes accumulated patches from distribution packages and performs code cleanup of workaround solutions used in zlib for supporting older compilers and platforms that hinder the implementation of more efficient methods (for example, limitations necessary for supporting 16-bit systems and compilers incompatible with ANSI C). Work has been done to identify and fix errors detected by static analyzers, fuzzing testing systems, and tools for identifying memory issues (AddressSanitizer and MemorySanitizer).
Source: opennet.ru
