make additional use of optimized linear search routines

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: make additional use of optimized linear search routines
Date: 2022-09-01 18:51:53
Message-ID: 20220901185153.GA783106@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Now that we have some optimized linear search routines [0], I thought I'd
quickly check whether we could use them elsewhere. To start, I took
another look at a previously posted patch [1] and noticed two potentially
useful applications of pg_lfind32(). The attached patches replace the
open-coded linear searches with calls to pg_lfind32(). I haven't done any
performance analysis with these patches yet, and the overall impact might
be limited, but it seemed like low-hanging fruit.

I'm hoping to spend a bit more time looking for additional applications of
the pg_lfind*() suite of functions (and anywhere else where SIMD might be
useful, really). If you have any ideas in mind, I'm all ears.

[0] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/port/pg_lfind.h
[1] https://postgr.es/m/20220802221301.GA742739%40nathanxps13

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

Attachment Content-Type Size
v1-0001-use-optimized-linear-search-in-TransactionIdIsInP.patch text/x-diff 1.2 KB
v1-0002-use-optimized-linear-search-in-XidIsConcurrent.patch text/x-diff 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2022-09-01 18:53:16 Re: Handle infinite recursion in logical replication setup
Previous Message vignesh C 2022-09-01 18:49:54 Re: Handle infinite recursion in logical replication setup