From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: make additional use of optimized linear search routines
Date: Wed, 21 Sep 2022 14:40:13 +0900
Message-ID: <YyqjvS3HumArAxwq@paquier.xyz> (raw)
In-Reply-To: <YxKosqGmCeagEtRi@paquier.xyz>
References: <20220901185153.GA783106@nathanxps13>
<CAMbWs4-aZr_SiAbKsoOjAN2v5OQ4+eWb7LSXHpHksK_Yr+-t3A@mail.gmail.com>
<20220902221611.GC1261322@nathanxps13>
<YxKosqGmCeagEtRi@paquier.xyz>
On Sat, Sep 03, 2022 at 10:06:58AM +0900, Michael Paquier wrote:
> Ohoh. This sounds like a good idea to me, close to what John has
> applied lately. I'll take a closer look..
So, the two code paths patched here are rather isolated. The one in
TransactionIdIsInProgress() requires an overflowed set of subxids
still running, something similar to what the isolation test
subxid-overflow does. XidIsConcurrent() is also kind of hard to
reason about with a benchmark.
Anyway, I did not know about the work done with SIMD instructions in
pg_lfind.h and after playing the API I have run some micro benchmarks
with on pg_lfind32() and I can see some improvements. With a range of
100~10k elements in a fixed number of repeated calls with a for loop
and lfind(), I could not get up to the 40% speedup. That was somewhat
closer to 15%~20% on x86 and 20%~25% with arm64. There is a trend
where things got better with a higher number of elements with
lfind().
In short, switching those code paths to use the linear search routines
looks like a good thing in the long-term, so I would like to apply
this patch. If you have any comments or objections, please feel
free.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, nathandbossart@gmail.com, guofenglinux@gmail.com
Subject: Re: make additional use of optimized linear search routines
In-Reply-To: <YyqjvS3HumArAxwq@paquier.xyz>
* 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