Zlib-ng 2.2 Speeds Up Compression By ~12% On x86_64 CPUs

Written by Michael Larabel in Free Software on 19 June 2024 at 10:18 AM EDT. 22 Comments
FREE SOFTWARE
The first release candidate of Zlib-ng 2.2 for this drop-in replacement to the Zlib data compression library is now available for testing. Zlib-ng continues to ship new performance optimizations and other tuning for providing faster Zlib performance on modern processors.

Zlib-ng continues to retain API compatibility with Zlib while also offering a modernized native API variant, a clean C11 syntax, and supporting a variety of CPU intrinsics for different architectures. The Zlib-ng 2.2 release candidate out today has a number of additional changes and new optimizations. Zlib-ng on x86_64 hardware at the default compression level is around 12% faster than prior releases.

Intel and AMD CPUs


Zlib-ng 2.2 has also been working on overhauling its memory allocation handling. As explained in today's release candidate announcement:
"This release contains several large changes and optimizations. On x86-64 for example, this leads to a compression speedup of ~12% on default level.

We also have a major reorganization of memory alloc/free to always happen during init, this allows applications to potentially do the init early and be finished with the malloc system calls before it needs to process latency sensitive compression/decompression. It also ensures that zlib-ng can not fail due to memory pressure after having run the init functions successfully. We also now only do a single memory allocation deflate or inflate, ensuring we do less system calls and the allocated buffers live close together in memory. Compression or decompression of very small buffers will now also be faster due to spending less time doing malloc/free."

Downloads and more details on the changes coming with Zlib-ng 2.2 can be found via the 2.2 release candidate announcement.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week