Re: use CLZ instruction in AllocSetFreeIndex()

From: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: use CLZ instruction in AllocSetFreeIndex()
Date: 2019-12-28 03:44:14
Message-ID: CACPNZCvFDeMGZNpnR_i+Ny3_zikjQULRD3omqU8Rf=LWJHVR7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 27, 2019 at 9:16 PM David Fetter <david(at)fetter(dot)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 Content-Type Size
v2-0001-Use-the-CLZ-instruction-in-AllocSetFreeIndex.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abdul Yadi AH-2 2019-12-28 04:33:43 PostgreSQL 12.1 patch for "private_modify" table creation option for data validation reinforcement
Previous Message Tom Lane 2019-12-28 03:29:15 Re: Allow WHEN in INSTEAD OF triggers