From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Micro-optimize pg_lfind32().
Date: Tue, 26 Mar 2024 19:06:26 +0000
Message-ID: <E1rpC7u-005ogb-6S@gemulon.postgresql.org> (raw)
Micro-optimize pg_lfind32().
This commit improves the performance of pg_lfind32() in many cases
by modifying it to process the remaining "tail" of elements with
SIMD instructions instead of processing them one-by-one. Since the
SIMD code processes a large block of elements, this means that we
will process a subset of elements more than once, but that won't
affect the correctness of the result, and testing has shown that
this helps more cases than it regresses. With this change, the
standard one-by-one linear search code is only used for small
arrays and for platforms without SIMD support.
Suggested-by: John Naylor
Reviewed-by: John Naylor
Discussion: https://postgr.es/m/20231129171526.GA857928%40nathanxps13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7644a7340c8a7764f1b20b34e1273b41347cbfcb
Modified Files
--------------
src/include/port/pg_lfind.h | 114 +++++++++++++++++++++++++++++---------------
1 file changed, 76 insertions(+), 38 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Micro-optimize pg_lfind32().
In-Reply-To: <E1rpC7u-005ogb-6S@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