Re: Improve CRC32C performance on SSE4.2 - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Improve CRC32C performance on SSE4.2
Date
Msg-id Z60QDnEuYptMjbQO@nathan
Whole thread Raw
In response to RE: Improve CRC32C performance on SSE4.2  ("Devulapalli, Raghuveer" <raghuveer.devulapalli@intel.com>)
Responses RE: Improve CRC32C performance on SSE4.2
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small memory fixes for pg_createsubcriber
Next
From: Daniel Gustafsson
Date:
Subject: Re: describe special values in GUC descriptions more consistently