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

From John Naylor
Subject Re: Improve CRC32C performance on SSE4.2
Date
Msg-id CANWCAZapv-=PcDBEd43AEiYZApweANpS=stOcSvaPowo6Ff1yw@mail.gmail.com
Whole thread Raw
In response to RE: Improve CRC32C performance on SSE4.2  ("Devulapalli, Raghuveer" <raghuveer.devulapalli@intel.com>)
List pgsql-hackers
On Tue, Feb 25, 2025 at 3:17 AM Devulapalli, Raghuveer
<raghuveer.devulapalli@intel.com> wrote:
>
> > Here's another idea to make it more automatic: Give up on initializing every
> > capability at once.
>
> I'm not sure I like giving up this. Initializing and running CPUID check with the attribute constructor is very
valuablefor two reasons: (1) you get everything done at load time before main and (2) you don’t have to run cpuid check
forevery feature (popcount, crc32c, or anything else you add in the future) multiple times. It keep the cpuid
functionalityin a central place that makes it a modular design. 

I agree it would be preferable to make a centralized check work.

> On MSVC, we could have the first SIMD feature call pg_cpucap_initialize() which runs CPUID stores the cpu features.
Anysubsequent call can skip (because it has already been initialized) by using a static variable or some other
approach.Does this make sense? 

Correct me if I'm misunderstanding, but this sounds like in every
frontend program we'd need to know what the first call was, which
seems less maintainable than just initializing at the start of every
frontend program.


--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: Shubham Khanna
Date:
Subject: Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Next
From: Damien Clochard
Date:
Subject: Security Label Inheritance