zlib replacement with optimizations for "next generation" systems.
Clone or download
bmrzycki and Dead2 bug #266: select std2 for gcc/clang ARM 32-bit builds
Running the Chromium zlib benchmark tool on a Hikey 970 device
showed uplifts for both gcc and clang when using std2 (larger is
better):

arm_h02_std3_gcc_0ca47588bd2e38/score.out  =  7.964881
arm_h02_std3_llvm_2e8efbb084ae87/score.out =  9.522024
arm_h02_std1_gcc_0ca47588bd2e38/score.out  =  9.641071
arm_h02_std2_gcc_0ca47588bd2e38/score.out  =  9.919345
arm_h02_std1_llvm_2e8efbb084ae87/score.out =  9.925893
arm_h02_std2_llvm_2e8efbb084ae87/score.out = 10.049107
Latest commit 3861e1b Jan 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
arch Replace the UNROLL_LESS define with UNROLL_MORE, making UNROLL_LESS t… Jan 21, 2019
doc zlib 1.2.5.1 Sep 11, 2011
test remove unused variable Jan 22, 2019
tools CMakeLists.txt: better checking for Intel intrinsics. Feb 13, 2017
win32 Replace the UNROLL_LESS define with UNROLL_MORE, making UNROLL_LESS t… Jan 21, 2019
.gitattributes Add a.exe to cleanup list. Jan 30, 2017
.gitignore integration of oss-fuzz in make test #204 (#206) Nov 7, 2018
.travis.yml Add scan-build cmake build to build matrix Jan 16, 2019
CMakeLists.txt Let deflate_medium be enabled by default. Jan 21, 2019
ChangeLog.zlib zlib 1.2.11 Feb 13, 2017
FAQ.zlib zlib 1.2.11 Feb 13, 2017
INDEX zlib 1.2.11 Feb 13, 2017
INSTALL Update readme file, and add install instructions Feb 28, 2017
LICENSE.md Update readme and create LICENSE.md file Apr 10, 2015
Makefile.in remove unused variables Jan 22, 2019
README.md Add Buildkite status badge Dec 13, 2018
README.zlib Add legal disclaimer to README. Dec 12, 2018
adler32.c Replace the UNROLL_LESS define with UNROLL_MORE, making UNROLL_LESS t… Jan 21, 2019
compress.c Move private defines from zconf.h and zconf-ng.h to zbuild.h Mar 22, 2018
configure remove unused variable Jan 22, 2019
crc32.c Replace the UNROLL_LESS define with UNROLL_MORE, making UNROLL_LESS t… Jan 21, 2019
crc32.h Add tables for crc32_combine(), to speed it up by a factor of 200. Dec 8, 2018
deflate.c Let deflate_medium be enabled by default. Jan 21, 2019
deflate.h remove `unaligned store` UBsan warnings Dec 18, 2018
deflate_fast.c move match.c to match_p.h and remove match.h Jan 16, 2019
deflate_medium.c Let deflate_medium be enabled by default. Jan 21, 2019
deflate_p.h return an index for hash map collisions in insert_string Dec 13, 2018
deflate_slow.c move match.c to match_p.h and remove match.h Jan 16, 2019
functable.c [ARM/AArch64] Add run-time detection of ACLE and NEON instructions un… Dec 12, 2018
functable.h Make functable thread-local. Sep 17, 2018
gzclose.c Move private defines from zconf.h and zconf-ng.h to zbuild.h Mar 22, 2018
gzendian.h avoid double definitions for LITTLE_ENDIAN and BYTE_ORDER Jan 9, 2019
gzguts.h COMP: Fix missing header unistd.h Jan 21, 2019
gzlib.c Avoid a conversion error in gzseek when off_t type too small. Jan 15, 2019
gzread.c Avoid some conversion warnings in gzread.c and gzwrite.c. Jan 15, 2019
gzwrite.c Return an error if the gzputs string length can't fit in an int. Jan 15, 2019
infback.c bug #117: speed up inflate_fast Dec 18, 2018
inffast.c Small speedup to inflate [psumbera]. Jan 15, 2019
inffast.h bug #117: speed up inflate_fast Dec 18, 2018
inffixed.h Get inffixed.h and MAKEFIXED result to match. Oct 6, 2011
inflate.c Don't compute check value for raw inflate if asked to validate. Jan 15, 2019
inflate.h Adapt code to support PREFIX macros and update build scripts Jan 31, 2018
inftrees.c Move private defines from zconf.h and zconf-ng.h to zbuild.h Mar 22, 2018
inftrees.h Style cleanup for inflate code May 25, 2015
match_p.h bug #266: select std2 for gcc/clang ARM 32-bit builds Jan 22, 2019
memcopy.h bug #117: speed up inflate_fast Dec 18, 2018
treebuild.xml zlib 1.2.11 Feb 13, 2017
trees.c Make the names in functions declarations identical to definitions. Dec 13, 2018
trees.h local -> static Jan 30, 2017
uncompr.c Move private defines from zconf.h and zconf-ng.h to zbuild.h Mar 22, 2018
zbuild.h Make functable thread-local. Sep 17, 2018
zconf-ng.h.in typedef ptrdiff_t when stddef.h does not provide it Jan 17, 2019
zconf.h.in typedef ptrdiff_t when stddef.h does not provide it Jan 17, 2019
zlib-ng.h Permit a deflateParams() parameter change as soon as possible. Jan 15, 2019
zlib-ng.map Add crc32_combine_gen() and crc32_combine_op() for fast combines. Dec 8, 2018
zlib.3 zlib 1.2.11 Feb 13, 2017
zlib.3.pdf zlib 1.2.11 Feb 13, 2017
zlib.h Permit a deflateParams() parameter change as soon as possible. Jan 15, 2019
zlib.map Add crc32_combine_gen() and crc32_combine_op() for fast combines. Dec 8, 2018
zlib.pc.cmakein Rename library based on zlib-compat setting Jan 31, 2018
zlib.pc.in Rename library based on zlib-compat setting Jan 31, 2018
zutil.c Fix compilation with --solo and --debug combined. Jan 9, 2019
zutil.h move MEMCPY and MEMSET to zutil.h Dec 12, 2018

README.md

zlib-ng - zlib for the next generation systems

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

Fork Motivation and History

The motivation for this fork was due to seeing several 3rd party contributions containing 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 lots of systems that predate the Internet. This is great, but it does complicate further development and maintainability. The zlib code has numerous workarounds for old compilers that do not understand ANSI-C 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. For example, the [v]s[n]printf workaround code has a whopping 8 different implementations just to cater to various old compilers. With this many workarounds cluttered throughout the code, new programmers with an idea/interest for zlib will need to take some time to figure out why all of these seemingly strange things are used, and how to work within those confines.

So I decided to make a fork, merge all the Intel optimizations, merge the Cloudflare optimizations that did not conflict, plus a couple of other smaller patches. Then I started cleaning out workarounds, various dead code, all contrib and example code as there is little point in having those in this fork for various reasons.

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

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

Contributing

Zlib-ng is a young project, and we aim to be open to contributions, and we would be delighted to receive pull requests on github. Just remember that any code you submit must be your own and it must be zlib licensed. Help with testing and reviewing of pull requests etc is also very much appreciated.

If you are interested in contributing, please consider joining our IRC channel #zlib-ng on the Freenode IRC network.

Acknowledgments

Thanks to Servebolt.com for sponsoring my maintainership of zlib-ng.

Thanks go out to all the people and companies who have taken the time to contribute code reviews, testing and/or patches. Zlib-ng would not have been nearly as good without you.

The deflate format used by zlib was defined by Phil Katz. The deflate and zlib specifications were written by L. Peter Deutsch.

zlib was originally created by Jean-loup Gailly (compression) and Mark Adler (decompression).

Build Status

Travis CI: build status Buildkite: Build status