Re: Optimize UUID parse using SIMD - Mailing list pgsql-hackers

From John Naylor
Subject Re: Optimize UUID parse using SIMD
Date
Msg-id CANWCAZa=R+ZC3EZ-PH68DFTbRtH7X1+uU3vgnKnZ-a7KRD4Leg@mail.gmail.com
Whole thread
In response to Re: Optimize UUID parse using SIMD  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
On Tue, Aug 18, 2026 at 5:21 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> I've updated the patch accordingly. Please review it.

+ * Note that this fast path is not conditional on SIMD support:
+ * hex_decode_safe() picks a vectorized or scalar implementation itself, and
+ * even its scalar implementation is far faster than string_to_uuid_scalar().

This doesn't seem like relevant info at the interface level -- I'd
just leave it out. The previous paragraph already states that it calls
out to hex_decode_safe() when possible. It's also confusing to later
read:

+ * Decode the UUID hex data using our hex decoder that is SIMD-aware. We

The relevant info at this point is not how hex_decode_safe() works --
that's internal to that function and the caller doesn't (and
shouldn't) need to know about it. It might be relevant to say that if
we've gotten this far the fast path is likely to be successful. That
then logically leads in to the mention of error handling. Speaking of,
'escontext' and 'esctx' are confusingly similar -- it should be
obvious from the name what the purpose of the private one is. Maybe
'scratch' or 'private' as a prefix.

--
John Naylor
Amazon Web Services



Attachment

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Proposal: Conflict log history table for Logical Replication
Next
From: Andrei Lepikhov
Date:
Subject: Re: Allow a prosupport function to be attached to an aggregate