git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: a60b8a5) | patch
Optimize pg_readv/pg_pwritev single vector case.
2023年11月29日 03:44:19 +0000 (16:44 +1300)
2023年11月29日 04:19:25 +0000 (17:19 +1300)
commit 15c9ac3629936a9bb5010155d3656e913027ccb7
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
configure diff | blob | blame | history
configure.ac diff | blob | blame | history
src/include/port/pg_iovec.h diff | blob | blame | history
src/port/meson.build diff | blob | blame | history
src/port/preadv.c [deleted file] blob | blame | history
src/port/pwritev.c [deleted file] blob | blame | history
src/tools/msvc/Mkvcbuild.pm diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /