Re: optimize atomic exchanges - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: optimize atomic exchanges
Date
Msg-id 20231201043522.GB1577008@nathanxps13
Whole thread Raw
In response to Re: optimize atomic exchanges  (Andres Freund <andres@anarazel.de>)
Responses Re: optimize atomic exchanges
List pgsql-hackers
On Thu, Nov 30, 2023 at 07:56:27PM -0800, Andres Freund wrote:
> On 2023-11-30 21:18:15 -0600, Nathan Bossart wrote:
>> Some rudimentary tests show a >40% speedup with this patch on x86_64.
> 
> On bigger machines, with contention, the wins are likely much higher. I see
> two orders of magnitude higher throughput in a test program that I had around,
> on a two socket cascade lake machine.  Of course it's also much less
> powerfull...

Nice.  Thanks for trying it out.

One thing on my mind is whether we should bother with the inline assembly
versions.  It looks like gcc has had __atomic since 4.7.0 (2012), so I'm
not sure we gain much from them.  OTOH they are pretty simple and seem
unlikely to cause too much trouble.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Add new for_each macros for iterating over a List that do not require ListCell pointer
Next
From: shveta malik
Date:
Subject: Re: Synchronizing slots from primary to standby