diff options
| author | Jussi Kivilinna <[email protected]> | 2022-02-12 14:38:36 +0000 |
|---|---|---|
| committer | Jussi Kivilinna <[email protected]> | 2022-03-08 18:00:31 +0000 |
| commit | 15df88d135ba08797c2aaf1023c6c606aed49943 (patch) | |
| tree | ac1f1b87b45e4cf1e2560723dd25c10aeb3a3248 /common/exechelp-posix.c | |
| parent | g10/cipher-aead: add fast path for avoid memcpy when AEAD encrypting (diff) | |
| download | gnupg-15df88d135ba08797c2aaf1023c6c606aed49943.tar.gz gnupg-15df88d135ba08797c2aaf1023c6c606aed49943.zip | |
iobuf: add zerocopy optimization for iobuf_read
* common/iobuf.h (iobuf_struct): Add 'e_d' substructure and members.
* common/iobuf.c (IOBUF_ZEROCOPY_THRESHOLD): New.
(iobuf_alloc): Clear 'iobuf->e_d'.
(underflow_target): Use 'iobuf->e_d' when configured to bypass copying
through 'iobuf->d.buf'.
(iobuf_read): Configure 'iobuf->e_d' for 'underflow' if 'iobuf->d.buf'
is empty and external buffer is larger than threshold.
--
Zero-copy operation in iobuf_read() and underflow() allow bypassing
'iobuf->d.buf' for greater performance. This mainly helps OCB
performance where additional memory copies through iobuf stack
can take significant portion of program time.
GnuPG-bug-id: T5828
Signed-off-by: Jussi Kivilinna <[email protected]>
Diffstat (limited to 'common/exechelp-posix.c')
0 files changed, 0 insertions, 0 deletions
