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