blog posts

hosting image
Zlib Compression

High Performance Zlib Compression

As a member of the Hyperscale SIG, Intel maintains a “hyperscale-intel” repository with optimized versions of packages, to help customers maximize their performance on Intel® architectures. As part of this work, we have released an optimized version of the Zlib package for both CentOS Stream 8 and CentOS Stream 9 yielding significant performance gains.

The optimized Zlib package is identical to the CentOS Stream Zlib package, but with two alternative implementations [1] to provide a fast and high-quality hash function on systems supporting SSE2 and AVX2 instructions. These result in dramatic ~11% and ~18% performance gains, respectively.

Performance Improvement Data

We evaluated the performance of our optimized versions in two distinct ways: 1) zpipe deflate, and 2)gnupg encryption. The results show tremendous improvement in all usages. For all tests, we averaged the results of 10 runs on both CentOS Stream 8 and CentOS Stream 9, and on Intel® platforms [2].

Zpipe Deflate

Since zpipe [3] directly uses Zlib’s deflate() function, in this test we recompiled zpipe linking against the enhanced Zlib, then used it to compress a 750MB file.

zpipe < qt-everywhere-opensource-src-5.0.0.tar > /dev/null 2>&1

Compared to the standard version of Zlib, our optimized version yielded 4.3-5.2% and 16.1-16.2% speedups for the SSE and AVX2 implementations.

GnuPG Encrypt

Since GnuPG uses Zlib compression, we measured how long it takes to encrypt 128MB, 256MB, 512MB, and 1GB sized sample files using GnuPG.

By Ali Erdinc Koroglu