Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key
Date
Msg-id 20231121045015.GC3521465@nathanxps13
Whole thread Raw
In response to simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key
List pgsql-hackers
On Mon, Nov 20, 2023 at 06:12:47PM -0800, Jeff Davis wrote:
> The caller could do something similar, so this option is not necessary,
> but it seems like it could be generally useful. It speeds things up for
> the search_path cache (and is an alternative to another patch I have
> that implements the same thing in the caller).

I'm mostly thinking out loud here, but could we just always do this?  I
guess you might want to avoid it if your SH_EQUAL is particularly expensive
and you know repeated lookups are rare, but maybe that's uncommon enough
that we don't really care.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Hide exposed impl detail of wchar.c
Next
From: Michael Paquier
Date:
Subject: Re: Simplify if/else logic of walsender CreateReplicationSlot