Re: Improve CRC32C performance on SSE4.2
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: "Devulapalli, Raghuveer" <raghuveer.devulapalli@intel.com>
Cc: John Naylor <johncnaylorls@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "Shankaran, Akash" <akash.shankaran@intel.com>
Date: 2025-02-12T21:18:06Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Include _mm512_zextsi128_si512() in AVX-512 configure probes.
- ccd5bc93fdfe 18.0 landed
-
Properly fix AVX-512 CRC calculation bug
- 43da394304fb 18.0 landed
-
Workaround code generation bug in clang
- f83f14881c7a 18.0 landed
-
Compute CRC32C using AVX-512 instructions where available
- 3c6e8c123896 18.0 landed
-
Inline CRC computation for small fixed-length input on x86
- e2809e3a1015 18.0 landed
-
Be more paranoid in configure's checks for CRC and POPCNT intrinsics.
- fdb5dd6331e3 18.0 cited
On Wed, Feb 12, 2025 at 09:02:27PM +0000, Devulapalli, Raghuveer wrote: > Also, do we really need to have both USE_SSE42_CRC32C and USE_SSE42_CRC32C_WITH_RUNTIME_CHECK > features support? The former macro is used to enable running the SSE42 version without a runtime check > when someone builds with -msse4.2. The code looks fine now, but the runtime dispatch rules get complicated > as we add the PCLMUL and AVX512 dispatch in the future. IMO, this additional complexity is not worth it. > The cpuid runtime dispatch runs just once when postgres server is first setup and would hardly affect performance. > Let me know what you think. I think the idea behind USE_SSE42_CRC32C is to avoid the function pointer overhead if possible. I looked at switching to always using runtime checks for this stuff, and we concluded that we'd better not [0]. [0] https://postgr.es/m/flat/20231030161706.GA3011%40nathanxps13 -- nathan