Re: use CLZ instruction in AllocSetFreeIndex() - Mailing list pgsql-hackers

From John Naylor
Subject Re: use CLZ instruction in AllocSetFreeIndex()
Date
Msg-id CACPNZCvFDeMGZNpnR_i+Ny3_zikjQULRD3omqU8Rf=LWJHVR7A@mail.gmail.com
Whole thread Raw
In response to Re: use CLZ instruction in AllocSetFreeIndex()  (David Fetter <david@fetter.org>)
Responses Re: use CLZ instruction in AllocSetFreeIndex()
List pgsql-hackers
On Fri, Dec 27, 2019 at 9:16 PM David Fetter <david@fetter.org> wrote:
> On Fri, Dec 27, 2019 at 07:02:02PM -0500, John Naylor wrote:
> > The lookup table case is less clear. Removing the shift results in
> > assembly that looks more like the C code and is slower for me. The
> > standard lookup table code uses some magic constants and does its own
> > constant folding by shifting 11 (8 + 3). In the absence of testing on
> > platforms that will actually exercise this path, it seems the
> > open-coded path should keep the shift for now. Thoughts?
>
> It's probably worth doing the things you've found unambiguous gains
> for as a patch, putting it on the next commitfest, and seeing what the
> commitfest.cputube.org machinery has to say about it.

Done in the attached.

> Maybe it'd be worth trying out a patch that enables CLZ for Windows,
> but that seems like a separate issue.

Agreed.

-- 
John Naylor                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Allow WHEN in INSTEAD OF triggers
Next
From: Abdul Yadi AH-2
Date:
Subject: PostgreSQL 12.1 patch for "private_modify" table creation option fordata validation reinforcement