Re: optimize lookups in snapshot [sub]xip arrays

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: John Naylor <jcnaylor(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: optimize lookups in snapshot [sub]xip arrays
Date: 2022-07-28 21:34:23
Message-ID: 20220728213423.GA408719@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 26, 2022 at 11:19:06AM -0700, Andres Freund wrote:
> On 2022-07-25 12:04:19 -0700, Nathan Bossart wrote:
>> From the discussion thus far, it seems there is interest in optimizing
>> [sub]xip lookups, so I'd like to spend some time moving it forward. I
>> think the biggest open question is which approach to take. Both the SIMD
>> and hash table approaches seem viable, but I think I prefer the SIMD
>> approach at the moment (see the last paragraph of quoted text for the
>> reasons). What do folks think?
> Agreed on all points.

Great! Here is a new patch. A couple notes:

* I briefly looked into seeing whether auto-vectorization was viable and
concluded it was not for these loops.

* I borrowed USE_SSE2 from one of John Naylor's patches [0]. I'm not sure
whether this is committable, so I would welcome thoughts on the proper
form. Given the comment says that SSE2 is supported by all x86-64
hardware, I'm not seeing why we need the SSE 4.2 checks. Is it not
enough to check for __x86_64__ and _M_AMD64?

* I haven't looked into adding an ARM implementation yet.


Nathan Bossart
Amazon Web Services:

Attachment Content-Type Size
v3-0001-Use-SSE2-intrinsics-for-XidInMVCCSnapshot.patch text/x-diff 5.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-28 21:50:56 Re: [Commitfest 2022-07] Patch Triage: Needs Review, Part 1
Previous Message Jacob Champion 2022-07-28 21:28:23 [Commitfest 2022-07] Patch Triage: Needs Review, Part 1