agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
To: Antonin Houska <[email protected]>
Cc: [email protected]
Subject: Re: Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?
Date: Wed, 10 Jul 2024 13:59:15 -0500
Message-ID: <Zo7aA2m35vGR56MN@nathan> (raw)
In-Reply-To: <36977.1720623613@antos>
References: <36977.1720623613@antos>

On Wed, Jul 10, 2024 at 05:00:13PM +0200, Antonin Houska wrote:
> I don't quite understand why TransactionIdIsCurrentTransactionId() implements
> binary search in ParallelCurrentXids "from scratch" instead of using
> bsearch().

I believe there are a number of open-coded binary searches in the tree.  My
concern with switching them to bsearch() would be the performance impact of
using a function pointer for the comparisons.  Perhaps we could add a
couple of inlined binary search implementations for common types to replace
many of the open-coded ones.

-- 
nathan





view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?
  In-Reply-To: <Zo7aA2m35vGR56MN@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox