Re: Proposal for enabling auto-vectorization for checksum calculations - Mailing list pgsql-hackers

From John Naylor
Subject Re: Proposal for enabling auto-vectorization for checksum calculations
Date
Msg-id CANWCAZZhyyieM9LSELXTuvh1qoAY0frmcEnSh9d4KzBbahQvRQ@mail.gmail.com
Whole thread Raw
In response to Re: Proposal for enabling auto-vectorization for checksum calculations  (Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>)
List pgsql-hackers
On Thu, Jan 15, 2026 at 3:04 PM Oleg Tselebrovskiy
<o.tselebrovskiy@postgrespro.ru> wrote:

> > So in v10 I separated the body of checksum_block to
> > a semi-private header to provide hardware-specific definitions
> > for core code, while also maintaining the same one that
> > external code expects
>
> I like the usage of a semi-internal header, less code duplication
> is always good

Glad to hear it.

> If I understand correctly, with how code is currently,
> external programms can define PG_CHECKSUM_INTERNAL manually,
> but then they won't have access to static functions inside of
> checksum.c, so all you get is a pointer that leads nowhere, correct?

Sounds right, but I'm not sure why an external program would define
it, because it's named...drumroll.."internal".

> I'd like to think that speeding up checksum calculation is something
> that some external programms could appreciate.

External programs are probably doing some one-off task, so I don't see
a reason to work harder.

> Also, not moving all those checksum files to src/port saves us from
> thinking about problems with meson and current external programs,
> but, I think, that after hardware checks are refactored, we could
> revisit the question of moving checksum[_impl].h/.c to src/port.

Refactoring the hardware checks is not going to make those two
problems go away, and I don't understand why you want to move anything
to begin with.

--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Proposal to allow setting cursor options on Portals
Next
From: Álvaro Herrera
Date:
Subject: Re: remove the unneeded header file math.h in binaryheap.c