From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use SSE2 in is_valid_ascii() where available.
Date: Fri, 26 Aug 2022 08:59:50 +0000
Message-ID: <E1oRVBt-001Gn0-D0@gemulon.postgresql.org> (raw)
Use SSE2 in is_valid_ascii() where available.
Per flame graph from Jelte Fennema, COPY FROM ... USING BINARY shows
input validation taking at least 5% of the profile, so it's worth trying
to be more efficient here. With this change, validation of pure ASCII is
nearly 40% faster on contemporary Intel hardware. To make this change
legible and easier to adopt to additional architectures, use helper
functions to abstract the platform details away.
Reviewed by Nathan Bossart
Discussion: https://www.postgresql.org/message-id/CAFBsxsG%3Dk8t%3DC457FXnoBXb%3D8iA4OaZkbFogFMachWif7mNnww%40ma...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/121d2d3d70ecdb2113b340c5f3b99a61341291af
Modified Files
--------------
src/common/wchar.c | 7 +++---
src/include/mb/pg_wchar.h | 38 ++++++++++++++++++++++----------
src/include/port/simd.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 14 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: john.naylor@postgresql.org
Subject: Re: pgsql: Use SSE2 in is_valid_ascii() where available.
In-Reply-To: <E1oRVBt-001Gn0-D0@gemulon.postgresql.org>
References: <E1oRVBt-001Gn0-D0@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