pgsql: Use SSE2 in is_valid_ascii() where available.

From: John Naylor <john(dot)naylor(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use SSE2 in is_valid_ascii() where available.
Date: 2022-08-26 08:59:50
Message-ID: E1oRVBt-001Gn0-D0@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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%40mail.gmail.com

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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2022-08-26 09:59:05 Re: pgsql: Use SSE2 in is_valid_ascii() where available.
Previous Message Peter Eisentraut 2022-08-26 08:45:30 pgsql: Remove obsolete comment