From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Introduce optimized routine for linear searches of arrays
Date: Wed, 10 Aug 2022 03:49:36 +0000
Message-ID: <E1oLcit-0004Qs-68@gemulon.postgresql.org> (raw)
Introduce optimized routine for linear searches of arrays
Use SSE2 intrinsics to speed up the search, where available. Otherwise,
use a simple 'for' loop. The motivation to add this now is to speed up
XidInMVCCSnapshot(), which is the reason only unsigned 32-bit integer
arrays are optimized. Other types are left for future work, as is the
extension of this technique to non-x86 platforms.
Nathan Bossart
Reviewed by: Andres Freund, Bharath Rupireddy, Masahiko Sawada
Discussion: https://postgr.es/m/20220713170950.GA3116318%40nathanxps13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b6ef167564905e8dab8af1b1dba0997ec61204ca
Modified Files
--------------
src/include/port/pg_lfind.h | 103 +++++++++++++++++++++
src/test/modules/Makefile | 1 +
src/test/modules/test_lfind/.gitignore | 4 +
src/test/modules/test_lfind/Makefile | 23 +++++
.../modules/test_lfind/expected/test_lfind.out | 12 +++
src/test/modules/test_lfind/sql/test_lfind.sql | 8 ++
src/test/modules/test_lfind/test_lfind--1.0.sql | 8 ++
src/test/modules/test_lfind/test_lfind.c | 52 +++++++++++
src/test/modules/test_lfind/test_lfind.control | 4 +
9 files changed, 215 insertions(+)
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: john.naylor@postgresql.org
Subject: Re: pgsql: Introduce optimized routine for linear searches of arrays
In-Reply-To: <E1oLcit-0004Qs-68@gemulon.postgresql.org>
References: <E1oLcit-0004Qs-68@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