postgresql/src/include/port
Nathan Bossart ec8719ccbf Optimize hex_encode() and hex_decode() using SIMD.
The hex_encode() and hex_decode() functions serve as the workhorses
for hexadecimal data for bytea's text format conversion functions,
and some workloads are sensitive to their performance.  This commit
adds new implementations that use routines from port/simd.h, which
testing indicates are much faster for larger inputs.  For small or
invalid inputs, we fall back on the existing scalar versions.
Since we are using port/simd.h, these optimizations apply to both
x86-64 and AArch64.

Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Chiranmoy Bhattacharya <chiranmoy.bhattacharya@fujitsu.com>
Co-authored-by: Susmitha Devanga <devanga.susmitha@fujitsu.com>
Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Discussion: https://postgr.es/m/aLhVWTRy0QPbW2tl%40nathan
2025-10-06 12:28:50 -05:00
..
atomics Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
win32 Fix gai_strerror() thread-safety on Windows. 2024-02-12 11:14:21 +13:00
win32_msvc windows: msvc: Define STDIN/OUT/ERR_FILENO. 2022-07-18 17:21:54 -07:00
atomics.h Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
cygwin.h Simplify declaring variables exported from libpgcommon and libpgport. 2021-11-29 11:00:00 -05:00
darwin.h Add prefetching support on macOS 2024-08-28 07:28:27 +02:00
freebsd.h Improve the naming in wal_sync_method code. 2023-10-13 15:16:45 -05:00
linux.h Improve the naming in wal_sync_method code. 2023-10-13 15:16:45 -05:00
netbsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
openbsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pg_bitutils.h Optimize popcount functions with ARM SVE intrinsics. 2025-03-28 16:20:20 -05:00
pg_bswap.h Grab the low-hanging fruit from forcing sizeof(Datum) to 8. 2025-08-13 17:18:22 -04:00
pg_crc32c.h Remove implicit cast from 'void *' 2025-07-02 11:51:10 +07:00
pg_iovec.h Make sure IOV_MAX is defined. 2025-07-01 12:40:35 -04:00
pg_lfind.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_numa.h Fix indentation in pg_numa code 2025-07-01 15:23:07 +02:00
pg_pthread.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
simd.h Optimize hex_encode() and hex_decode() using SIMD. 2025-10-06 12:28:50 -05:00
solaris.h Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
win32.h mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc 2022-09-30 10:50:05 -07:00
win32_port.h Revert "Tidy up locale thread safety in ECPG library." 2025-03-28 21:27:37 +01:00
win32ntdll.h Update copyright for 2025 2025-01-01 11:21:55 -05:00