From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Used optimized linear search in more code paths
Date: Thu, 22 Sep 2022 00:48:15 +0000
Message-ID: <E1obANz-001Q8x-3H@gemulon.postgresql.org> (raw)
Used optimized linear search in more code paths
This commit updates two code paths to use pg_lfind32() introduced by
b6ef167 with TransactionId arrays:
- At the end of TransactionIdIsInProgress(), when checking for the case
of still running but overflowed subxids.
- XidIsConcurrent(), when checking for a serializable conflict.
These cases are less impactful than 37a6e5d, but a bit of
micro-benchmarking of this API shows that linear search speeds up by
~20% depending on the number of items involved (x86_64 and amd64 looked
at here).
Author: Nathan Bossart
Reviewed-by: Richard Guo, Michael Paquier
Discussion: https://postgr.es/m/20220901185153.GA783106@nathanxps13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/14ff44f80c09718d43d853363941457f5468cc03
Modified Files
--------------
src/backend/storage/ipc/procarray.c | 12 ++++--------
src/backend/storage/lmgr/predicate.c | 10 ++--------
2 files changed, 6 insertions(+), 16 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz
Subject: Re: pgsql: Used optimized linear search in more code paths
In-Reply-To: <E1obANz-001Q8x-3H@gemulon.postgresql.org>
References: <E1obANz-001Q8x-3H@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox