]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
Speed up chunkcopy and memset
authorAdam Stylinski <kungfujesus06@gmail.com>
Mon, 21 Feb 2022 21:52:17 +0000 (16:52 -0500)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 16 Mar 2022 10:42:19 +0000 (11:42 +0100)
commit49a6bb5d413fef477a76111e1a5946452ff9d4a8
tree6ba0a78679607d7e655e7cda3fc11320dac14798
parentff554565c09ee52e7503d817e26ce090ac0cf5c3
Speed up chunkcopy and memset

This was found to have a significant impact on a highly compressible PNG
for both the encode and decode.  Some deltas show performance improving
as much as 60%+.

For the scenarios where the "dist" is not an even modulus of our chunk
size, we simply repeat the bytes as many times as possible into our
vector registers.  We then copy the entire vector and then advance the
quotient of our chunksize divided by our dist value.

If dist happens to be 1, there's no reason to not just call memset from
libc (this is likely to be just as fast if not faster).
chunkset_tpl.h
functable.c
functable.h
inffast.c
inflate.c
inflate_p.h