Re: optimize atomic exchanges

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: optimize atomic exchanges
Date: 2023-12-01 04:35:22
Message-ID: 20231201043522.GB1577008@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2023-12-01 04:51:03 Re: Synchronizing slots from primary to standby
Previous Message Nathan Bossart 2023-12-01 04:20:20 Re: Add new for_each macros for iterating over a List that do not require ListCell pointer