[Zlib-devel] minigzip vs. my own zlib client

Mark Adler madler at alumni.caltech.edu
Sun Jun 4 18:31:09 EDT 2006


On Jun 4, 2006, at 3:06 PM, Mikhail Teterin wrote:
> That is not true -- at least, not on my Opteron (FreeBSD/amd64).  
> Using 8 is
> much faster AND more efficient, than 9... Looks like a bug...

No, not a bug.  That's just the way it is.  Though the documentation  
could use some updating.

The single memory parameter is used to adjust two different things:  
the allowed size of the hash tables for searching for matching  
strings, and the number of symbols per deflate block.  They can have  
opposite effects on compression, which is why in your case memory  
level 9 compresses worse than memory level 8.  There is a happy  
deflate block size, where it's not so small that the code description  
at the beginning of the block costs too much, and not so big that the  
codes cannot adapt fast enough for changing data statistics.  That  
happy place is highly data dependent, but in general memory level 8  
works best.

mark





More information about the Zlib-devel mailing list