pgsql: Inline CRC computation for small fixed-length input on x86 - Mailing list pgsql-committers

From John Naylor
Subject pgsql: Inline CRC computation for small fixed-length input on x86
Date
Msg-id E1tz8dY-001tOE-31@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Inline CRC computation for small fixed-length input on x86
List pgsql-committers
Inline CRC computation for small fixed-length input on x86

pg_crc32c.h now has a simplified copy of the loop in pg_crc32c_sse42.c
suitable for inlining where possible.

This may slightly reduce contention for the WAL insertion lock,
but that hasn't been tested. The motivation for this change is avoid
regressing for a future commit that will use a function pointer for
non-constant input in all x86 builds.

While it's technically possible to make a similar change for Arm and
LoongArch, there are some questions about how inlining should work
since those platforms prefer stricter alignment. There are also no
immediate plans to add additional implementations for them.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Raghuveer Devulapalli <raghuveer.devulapalli@intel.com>
Discussion: https://postgr.es/m/CANWCAZZEiTzhZcuwTiJ2=opiNpAUn1vuDRu1N02z61AthwRZLA@mail.gmail.com
Discussion: https://postgr.es/m/CANWCAZYRhLHArpyfV4uRK-Rw9N5oV5HMkkKtBehcuTjNOMwCZg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e2809e3a1015697832ee4d37b75ba1cd0caac0f0

Modified Files
--------------
src/include/port/pg_crc32c.h | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Add relallfrozen to pg_dump statistics.
Next
From: John Naylor
Date:
Subject: Re: pgsql: Inline CRC computation for small fixed-length input on x86