pgsql: Use SSE2 in is_valid_ascii() where available. - Mailing list pgsql-committers

From John Naylor
Subject pgsql: Use SSE2 in is_valid_ascii() where available.
Date
Msg-id E1oRVBt-001Gn0-D0@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Use SSE2 in is_valid_ascii() where available.  (John Naylor <john.naylor@enterprisedb.com>)
List 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(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Remove obsolete comment
Next
From: John Naylor
Date:
Subject: Re: pgsql: Use SSE2 in is_valid_ascii() where available.