Re: Use compiler intrinsics for bit ops in hash

David Fetter <david@fetter.org>

From: David Fetter <david@fetter.org>
To: Jesse Zhang <sbjesse@gmail.com>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2020-02-26T08:12:24Z
Lists: pgsql-hackers

Attachments

On Fri, Jan 31, 2020 at 04:59:18PM +0100, David Fetter wrote:
> On Wed, Jan 15, 2020 at 03:45:12PM -0800, Jesse Zhang wrote:
> > On Tue, Jan 14, 2020 at 2:09 PM David Fetter <david@fetter.org> wrote:
> > > > The changes in hash AM and SIMPLEHASH do look like a net positive
> > > > improvement. My biggest cringe might be in pg_bitutils:
> > > >
> > > > 1. Is ceil_log2_64 dead code?
> > >
> > > Let's call it nascent code. I suspect there are places it could go, if
> > > I look for them.  Also, it seemed silly to have one without the other.
> > >
> > 
> > While not absolutely required, I'd like us to find at least one
> > place and start using it. (Clang also nags at me when we have
> > unused functions).
> 
> Done in the expanded patches attached.

These bit-rotted a little, so I've updated them.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Commits

  1. Modify additional power 2 calculations to use new helper functions

  2. Modify various power 2 calculations to use new helper functions

  3. Add functions to calculate the next power of 2

  4. Move src/backend/utils/hash/hashfn.c to src/common