Re: Optimize UUID parse using SIMD

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Haibo Yan <tristan(dot)yim(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize UUID parse using SIMD
Date: 2026-08-18 08:53:25
Message-ID: CANWCAZa=R+ZC3EZ-PH68DFTbRtH7X1+uU3vgnKnZ-a7KRD4Leg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 18, 2026 at 5:21 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bohyun Lee 2026-08-18 09:02:34 Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically
Previous Message Daniel Gustafsson 2026-08-18 08:41:51 Re: pg_control_checkpoint(): add "data_checksum_version" (Pg19)?