Re: Change GUC hashtable to use simplehash?

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gurjeet Singh <gurjeet(at)singh(dot)im>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change GUC hashtable to use simplehash?
Date: 2023-12-20 06:48:22
Message-ID: CANWCAZa6QU8-pXDj2mrOhVx7c3=jws6nnhXv1FnfgTD5MXEuiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 20, 2023 at 3:23 AM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
>
> On Tue, 2023-12-19 at 16:23 +0700, John Naylor wrote:
> > That wasn't the next place I thought to look (that would be the
> > strcmp
> > call), but something like this could be worthwhile.
>
> The reason I looked here is that the inner while statement (to find the
> chunk size) looked out of place and possibly slow, and there's a
> bitwise trick we can use instead.

There are other bit tricks we can use. In v11-0005 Just for fun, I
translated a couple more into C from

https://github.com/openbsd/src/blob/master/lib/libc/arch/amd64/string/strlen.S

Attachment Content-Type Size
v11-0003-Use-fasthash32-for-pgstat_hash_hash_key.patch text/x-patch 1.6 KB
v11-0002-Use-fasthash-for-the-search-path-cache.patch text/x-patch 2.1 KB
v11-0005-Optimize-tail-with-inspiration-from-OpenBSD.patch text/x-patch 2.4 KB
v11-0001-Add-inlineable-incremental-hash-functions-for-in.patch text/x-patch 7.9 KB
v11-0004-Jeff-Davis-v10jd-0004.patch text/x-patch 3.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2023-12-20 06:51:05 Re: Add new for_each macros for iterating over a List that do not require ListCell pointer
Previous Message Peter Smith 2023-12-20 06:31:38 Re: Synchronizing slots from primary to standby