aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/variable.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-11-29 16:44:19 +1300
committerThomas Munro <tmunro@postgresql.org>2023-11-29 17:19:25 +1300
commit15c9ac3629936a9bb5010155d3656e913027ccb7 (patch)
tree7af568a8acbb602d6a1f758e640a8099456df7d2 /src/backend/commands/variable.c
parenta60b8a58f435c44fc54e904cb05784b49dc04d0e (diff)
downloadpostgresql-15c9ac3629936a9bb5010155d3656e913027ccb7.tar.gz
postgresql-15c9ac3629936a9bb5010155d3656e913027ccb7.zip
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
Diffstat (limited to 'src/backend/commands/variable.c')
0 files changed, 0 insertions, 0 deletions