postgresql/src
Thomas Munro 15c9ac3629 Optimize pg_readv/pg_pwritev single vector case.
For the trivial case of iovcnt == 1, kernels are measurably slower at
dealing with the more complex arguments of preadv/pwritev than the
equivalent plain old pread/pwrite.  The overheads are worth it for
iovcnt > 1, but for 1 let's just redirect to the cheaper calls.  While
we could leave it to callers to worry about that, we already have to
have our own pg_ wrappers for portability reasons so it seems
reasonable to centralize this knowledge there (thanks to Heikki for this
suggestion).  Try to avoid function call overheads by making them
inlinable, which might also allow the compiler to avoid the branch in
some cases.  For systems that don't have preadv and pwritev (currently:
Windows and [closed] Solaris), we might as well pull the replacement
functions up into the static inline functions too.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com
2023-11-29 17:19:25 +13:00
..
backend Make use FullTransactionId in 2PC filenames 2023-11-29 01:43:36 +02:00
bin psql: Add tab completion for view options. 2023-11-28 09:50:17 +00:00
common Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the backend 2023-11-28 08:35:50 +09:00
fe_utils Remove unneeded assignments in for loop header 2023-11-21 16:10:27 +01:00
include Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
interfaces Use BIO_{get,set}_app_data instead of BIO_{get,set}_data. 2023-11-28 12:34:03 -05:00
makefiles Remove distprep 2023-11-06 15:18:04 +01:00
pl Don't specify number of dimensions in cases where we don't know it. 2023-11-17 11:29:46 -05:00
port Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Add SLRU tests for 64-bit page case 2023-11-29 01:44:01 +02:00
timezone Remove distprep 2023-11-06 15:18:04 +01:00
tools Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00