Thread: pgsql: Use SSE2 in is_valid_ascii() where available.
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(-)
On Fri, Aug 26, 2022 at 3:59 PM John Naylor <john.naylor@postgresql.org> wrote: > Per flame graph from Jelte Fennema, COPY FROM ... USING BINARY shows For the archives: This is not correct syntax: should be COPY BINARY or ... WITH BINARY. -- John Naylor EDB: http://www.enterprisedb.com