aboutsummaryrefslogtreecommitdiff
path: root/zconf.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-11-05 08:43:29 -0700
committerMark Adler <madler@alumni.caltech.edu>2016-12-04 07:48:47 -0800
commit9dc5a8585f429109ef1948ab71b6b71bfa7181e2 (patch)
tree334ecf8e4d86004a967bef2b6f9901792d64934a /zconf.h
parent7161ad76e2d0ac7de2a6235fcad3b9dfc99e9140 (diff)
downloadzlib-9dc5a8585f429109ef1948ab71b6b71bfa7181e2.tar.gz
zlib-9dc5a8585f429109ef1948ab71b6b71bfa7181e2.tar.bz2
zlib-9dc5a8585f429109ef1948ab71b6b71bfa7181e2.zip
Speed up deflation for level 0 (storing).
The previous code slid the window and the hash table and copied every input byte three times in order to just write the data as stored blocks with no compression. This commit minimizes sliding and copying, especially for large input and output buffers. Level 0 compression is now more than 20 times faster than before the commit. Most of the speedup is due to deferring hash table slides until deflateParams() is called to change the compression level away from 0. More speedup is due to copying directly from next_in to next_out when the amounts of available input data and output space permit it, avoiding the intermediate pending buffer. Additionally, only the last 32K of the used input data is copied back to the sliding window when large input buffers are provided.
Diffstat (limited to 'zconf.h')
0 files changed, 0 insertions, 0 deletions