pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Devulapalli, Raghuveer <raghuveer.devulapalli@intel.com>
Cc: John Naylor <johncnaylorls@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: Shankaran, Akash <akash.shankaran@intel.com>
Subject: Re: Improve CRC32C performance on SSE4.2
Date: Wed, 12 Feb 2025 15:18:06 -0600
Message-ID: <Z60QDnEuYptMjbQO@nathan> (raw)
In-Reply-To: <PH8PR11MB82860A6C0E5C4B384B52E55AFBFC2@PH8PR11MB8286.namprd11.prod.outlook.com>
References: <PH8PR11MB82869FF741DFA4E9A029FF13FBF72@PH8PR11MB8286.namprd11.prod.outlook.com>
	<PH8PR11MB8286F844321BA1DEEC518348FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com>
	<CANWCAZYXk9xWrjEPNsm1oGYZ4CHBSVonn4XcCfWnusg+s_wiEA@mail.gmail.com>
	<PH8PR11MB828604A88A2E6C5EB5FF71E1FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com>
	<CANWCAZZZWQc3VQauZ2bCPxDxKpjKbV7z=zntGu3zD1HgT76Fdw@mail.gmail.com>
	<PH8PR11MB82860A6C0E5C4B384B52E55AFBFC2@PH8PR11MB8286.namprd11.prod.outlook.com>

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





view thread (82+ messages)  latest in thread

Message-ID: <Z60QDnEuYptMjbQO@nathan>
Permalink:  ../Z60QDnEuYptMjbQO@nathan/
Also on:    postgresql.org/message-id/Z60QDnEuYptMjbQO@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, raghuveer.devulapalli@intel.com, johncnaylorls@gmail.com, akash.shankaran@intel.com
  Subject: Re: Improve CRC32C performance on SSE4.2
  In-Reply-To: <Z60QDnEuYptMjbQO@nathan>
  References: <PH8PR11MB82869FF741DFA4E9A029FF13FBF72@PH8PR11MB8286.namprd11.prod.outlook.com> <PH8PR11MB8286F844321BA1DEEC518348FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com> <CANWCAZYXk9xWrjEPNsm1oGYZ4CHBSVonn4XcCfWnusg+s_wiEA@mail.gmail.com> <PH8PR11MB828604A88A2E6C5EB5FF71E1FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com> <CANWCAZZZWQc3VQauZ2bCPxDxKpjKbV7z=zntGu3zD1HgT76Fdw@mail.gmail.com> <PH8PR11MB82860A6C0E5C4B384B52E55AFBFC2@PH8PR11MB8286.namprd11.prod.outlook.com> <Z60QDnEuYptMjbQO@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox