[Zlib-devel] Optimizations needed for gzgets() (Zlib version 1.2.3)

Mark Adler madler at alumni.caltech.edu
Wed Jan 6 12:50:00 EST 2010


On Jan 6, 2010, at 8:53 AM, Scott_Riley at amat.com wrote:
> Is there another library that will decompress these gzip compressed files
> faster than Zlib or do they need to uncompress the files and then use the
> compression and decompression routines from another library such as Lzop?

For lzop they would need to recompress the data.

There is no open source code faster than zlib to decompress gzip data that I'm aware of.  (I haven't tested any commercial products, so it is possible that something out there is faster.)  There are however options within zlib to decrease the decompression time.  First off, unless you really need to know where the end of each line is, you shouldn't use gzgets(), since that just wastes time looking for the end-of-line characters.  Second, if you are decompressing from a file, you can consider the use of inflateBack() which uses a call-back interface to reduce some of the data-copying overhead of inflate().  You would use inflate() before that to process the gzip header, since inflateBack() only processes the raw deflate data.  There is also some assembler code to potentially speed up inflate in the contrib directory, though I have not tested those.

Mark





More information about the Zlib-devel mailing list