diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-02-13 14:26:48 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-02-13 14:26:48 -0500 |
commit | 0eb9265fe737d901f484e4bcd73ffe386eb35693 (patch) | |
tree | 3d03034cf4d3d884ec7bc8c6efd88ebd3f5764f7 /gcc/c | |
parent | cb76d7e47693364861e63ea3bb274b1b5295a943 (diff) | |
download | gcc-0eb9265fe737d901f484e4bcd73ffe386eb35693.zip gcc-0eb9265fe737d901f484e4bcd73ffe386eb35693.tar.gz gcc-0eb9265fe737d901f484e4bcd73ffe386eb35693.tar.bz2 |
c++/modules: use optimized crc32 from zlib
The current implementation of bytes::calc_crc computes the checksum one
byte at a time which turns out to be quite slow, accounting for 15% of
streaming in time for a modular Hello World. We have a crc32_unsigned
version that processes 4 bytes at a time which we could use here, but
since we bundle zlib we might as well use its highly optimized crc
routines that can process up to 32 bytes at a time.
So this patch makes us use zlib's crc32 in this hot code path. This
reduces stream in time for a modular Hello World by around 15% for me
with a release compiler.
gcc/cp/ChangeLog:
* Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
* module.cc: Include <zlib.h>.
(bytes::calc_crc): Use crc32 from zlib.
(bytes_out::set_crc): Use crc32_combine from zlib.
Reviewed-by: Jason Merill <jason@redhat.com>
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions