Home GnuPG
Diffusion GnuPG 69b0fa55f610

kbx: Use custom estream buffering

Description

kbx: Use custom estream buffering

* kbx/keybox-init.c (ll_buffer_size): New var intialized to 128k
(stream_buffers): New var.
(keybox_set_buffersize): New.
(_keybox_ll_open, _keybox_ll_close): Implement buffering.
* sm/gpgsm.c (oKbxBufferSize): New.
(opts): Add option --kbx-buffer-size.
(main): Call keybox_set_buffersize.
* g10/gpg.c: Include keybox.h.
* (oKbxBufferSize): New.
(opts): Add option --kbx-buffer-size.
(main): Call keybox_set_buffersize.

Commit message from 2.4:

Running a test on Windows using a pubring.kbx with
Total number of blobs: 2098

openpgp:     1294
   x509:      803

and a size of 42MiB with

gpgsm -k --with-validation --disable-dirmngr --kbx-buffer-size N >nul

gives these performance figures using procmon

N(k)file eventstime(s)
------+-------------+---------
0490000086
16245600058
32123300043
6462200037
12831700032
25616400031
5128800030

Using _open instead of CreateFile give the same number of file events
but increased the time slight by one second for the measured buffer
size of 64k and 128k. Benchmarks for gpg have not been conducted.

Details

Provenance
wernerAuthored on May 8 2023, 9:16 AM
Parents
rG0a4ccab3bd0a: kbx: Use wrapper functions for es_fclose and es_fopen.
Branches
Unknown
Tags
Unknown