ForkSnowflake (Arctic)Snowflake (Arctic)published Mar 17, 2026seen 5d

Snowflake-Labs/zlib-ng

forked from zlib-ng/zlib-ng

Open original ↗

Captured source

source ↗
published Mar 17, 2026seen 5dcaptured 11hhttp 200method plain

Snowflake-Labs/zlib-ng

Description: zlib replacement with optimizations for "next generation" systems.

License: Zlib

Stars: 0

Forks: 0

Open issues: 0

Created: 2026-03-17T09:23:25Z

Pushed: 2026-04-09T17:29:26Z

Default branch: develop

Fork: yes

Parent repository: zlib-ng/zlib-ng

Archived: no

README: | CI | Stable | Develop | |:---|:-------|:--------| | GitHub Actions | ![Stable CMake](https://github.com/zlib-ng/zlib-ng/actions/workflows/cmake.yml?query=branch%3Astable) ![Stable Configure](https://github.com/zlib-ng/zlib-ng/actions/workflows/configure.yml?query=branch%3Astable) | ![Develop CMake](https://github.com/zlib-ng/zlib-ng/actions/workflows/cmake.yml?query=branch%3Adevelop) ![Develop Configure](https://github.com/zlib-ng/zlib-ng/actions/workflows/configure.yml?query=branch%3Adevelop) | | CodeFactor | ![CodeFactor](https://www.codefactor.io/repository/github/zlib-ng/zlib-ng/overview/stable) | ![CodeFactor](https://www.codefactor.io/repository/github/zlib-ng/zlib-ng/overview/develop) | | OSS-Fuzz | ![Fuzzing Status](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:zlib-ng) | ![Fuzzing Status](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:zlib-ng) | | Coveralls | ![Coverage Status](https://coveralls.io/github/zlib-ng/zlib-ng?branch=stable) | ![Coverage Status](https://coveralls.io/github/zlib-ng/zlib-ng?branch=develop) |

zlib-ng

*zlib data compression library for the next generation systems*

Maintained by Hans Kristian Rosbach aka Dead2 (zlib-ng àt circlestorm dót org)

Features --------

  • Zlib compatible API with support for dual-linking
  • Modernized native API based on zlib API for ease of porting
  • Major speed improvements, x86-64 can be about 4x faster than stock zlib for example.
  • Modern C11 syntax and a 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, 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, Neon, Power8, VMX & VSX, LSX, LASX
  • Compare256 implementations using SSE2, AVX2, AVX512, Neon, Power9, LSX, LASX, RVV
  • Inflate chunk copying using SSE2, SSSE3, AVX2, AVX512, Neon, Power8, VSX, LSX, LASX, RVV
  • Support for hardware-accelerated deflate using IBM Z DFLTCC
  • Safe unaligned memory read/writes and large bit buffer improvements
  • Includes improvements from Cloudflare and Intel forks
  • Configure and CMake build system support
  • Comprehensive set of CMake unit tests
  • Code sanitizers, fuzzing, and coverage
  • GitHub Actions continuous integration on Windows, macOS, and Linux
  • Native CI for Aarch64, S390x, x86, x86-64
  • Emulated CI for ARM, LoongArch, PPC, PPC64, RISCV, SPARC64, S390x using qemu

History -------

The motivation for this fork was seeing several 3rd party contributions with new optimizations not getting implemented into the official zlib repository.

Mark Adler has been maintaining zlib for a very long time, and he has done a great job and hopefully he will continue for a long time yet. The idea of zlib-ng is not to replace zlib, but to co-exist as a drop-in replacement with a lower threshold for code change.

zlib has a long history and is incredibly portable, even supporting many systems that predate the Internet.

That is great, but it can complicate further development and maintainability. The zlib code contains many workarounds for really old compilers or to accommodate systems with limitations such as operating in a 16-bit environment.

Many of these workarounds are only maintenance burdens, some of them are pretty huge code-wise. With many workarounds cluttered throughout the code, it makes it harder for new programmers with an idea/interest for zlib to contribute.

I decided to make a fork, merge all the Intel optimizations, some of the Cloudflare optimizations, plus a couple other smaller patches. Then started cleaning out workarounds, various dead code, all contrib and example code.

The result is a better performing and easier to maintain zlib-ng.

A lot of improvements have gone into zlib-ng since its start, and numerous people and companies have contributed both small and big improvements, or valuable testing.

Build ----- Please read LICENSE.md, it is very simple and very liberal.

There are two ways to build zlib-ng:

Cmake

To build zlib-ng using the cross-platform makefile generator cmake.

cmake .
cmake --build . --config Release
ctest --verbose -C Release

Alternatively, you can use the cmake configuration GUI tool ccmake:

ccmake .

Configure

To build zlib-ng using the bash configure script:

./configure
make
make test

Build Options -------------

| CMake | configure | Description | Default | |:---------------------------|:-------------------------|:------------------------------------------------------------------------------------|---------| | ZLIB_COMPAT | --zlib-compat | Compile with zlib compatible API | OFF | | ZLIB_ALIASES | | Provide zlib compatible CMake targets | ON | | WITH_GZFILEOP | --without-gzfileops | Compile with support for gzFile related functions | ON | | WITH_OPTIM | --without-optimizations | Build with optimisations | ON | | WITH_NEW_STRATEGIES | --without-new-strategies | Use new strategies | ON | | WITH_CRC32_CHORBA | | Build with Chorba optimized CRC32 | ON | | WITH_REDUCED_MEM | --with-reduced-mem | Reduce zlib-ng memory usage, affects performance and compression ratio | OFF | | WITH_GTEST |…

Excerpt shown — open the source for the full document.

Notability

notability 1.0/10

Routine fork of existing repo