Home GnuPG
Diffusion GnuPG b96eb6f08d1d

iobuf: add zerocopy optimization for iobuf_write

Description

iobuf: add zerocopy optimization for iobuf_write

* common/iobuf.c (filter_flush): Use 'iobuf->e_d' if configured.
(iobuf_write): Configure 'iobuf->e_d' for 'filter_flush' if
'iobuf->d.buf' is empty and external buffer is larger than threshold.

Zero-copy operation in iobuf_write() and filter_flush() 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 <jussi.kivilinna@iki.fi>