Skip to content

Deflate config comparison

Nathan Moinvaziri edited this page Dec 13, 2021 · 2 revisions

The deflate configuration table used in zlib-ng is different than what is used in zlib. Due to this difference, the compression speed and ratio at each compression level will vary compared to zlib. These differences are important to note when doing performance comparisons between zlib-ng and zlib or other zlib forks.

Zlib-ng configuration table

Level Good length Max lazy Nice Length Max Chain Algorithm
0 0 0 0 0 Store
1 4 4 8 4 Deflate quick (Intel)
2 4 5 16 8 Deflate fast (Zlib)
3 4 6 32 32 Deflate fast (Zlib)
4 4 4 16 16 Deflate medium (Intel)
5 8 16 32 32 Deflate medium (Intel)
6 8 16 128 128 Deflate medium (Intel)
7 8 32 128 256 Deflate slow (Zlib)
8 32 128 258 1024 Deflate slow (Zlib)
9 32 258 258 4096 Deflate slow (Zlib) + fast-zlib changes

Zlib configuration table

Level Good length Max lazy Nice Length Max Chain Algorithm
0 0 0 0 0 Store
1 4 4 8 4 Deflate fast (Zlib)
2 4 5 16 8 Deflate fast (Zlib)
3 4 6 32 32 Deflate fast (Zlib)
4 4 4 16 16 Deflate slow (Zlib)
5 8 16 32 32 Deflate slow (Zlib)
6 8 16 128 128 Deflate slow (Zlib)
7 8 32 128 256 Deflate slow (Zlib)
8 32 128 258 1024 Deflate slow (Zlib)
9 32 258 258 4096 Deflate slow (Zlib)