[Zlib-devel] Some inflate_fast() statistics

Mark Adler madler at alumni.caltech.edu
Sat Nov 4 22:50:10 EST 2006


On Nov 1, 2006, at 1:20 PM, Steve Snyder wrote:
> (A mystery: according to the comments in the original code, 3 bytes
> is the minimum data size to copy.  Yet there appears to be copies
> of 1- and 2-byte lengths.  Hmm.....)

In fact, the deflate format only provides for matches of lengths 3  
through 258.

You are counting only some of the bytes being copied based on the  
piece of code that you cut out.  That part of inflate_fast() copies  
bytes from the output buffer (to the output buffer), which isn't  
always where they come from.  Sometimes they come from a saved  
sliding window.  So you are seeing a small number of cases where some  
number of bytes were copied from the sliding window, and only one or  
two are left to copy from the output buffer.

mark





More information about the Zlib-devel mailing list