]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
IMPORT: slz: use the generic function for the last bytes of the crc32
authorWilly Tarreau <w@1wt.eu>
Wed, 12 May 2021 06:34:36 +0000 (08:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 May 2021 07:29:29 +0000 (09:29 +0200)
This is the only place where we conditionally use the crc32_fast table,
better call the crc32_char inline function for this. This should also
reduce by ~1kB the L1 cache footprint of the compression when dealing
with small blocks, and at least shows a consistent 0.5% perf improvement.

This is slz upstream commit 075351b6c2513b548bac37d6582e46855bc7b36f.

src/slz.c

index a9104ea9effd29bf23fe64b91969e03c237497f7..76e89e20e2d42215cc743214d88296ccb40ffa92 100644 (file)
--- a/src/slz.c
+++ b/src/slz.c
@@ -969,7 +969,7 @@ uint32_t slz_crc32_by4(uint32_t crc, const unsigned char *buf, int len)
        }
 
        while (buf < end)
-               crc = crc32_fast[0][(crc ^ *buf++) & 0xff] ^ (crc >> 8);
+               crc = crc32_char(crc, *buf++);
        return crc;
 }