1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
Jussi Kivilinna 2b5718c1f7 common/iobuf: optimize iobuf_read_line
* common/iobuf.c (iobuf_read_line): Add fast path for finding '\n'
character in buffer.
--

This patch reduce per byte overhead in iobuf_read_line by avoiding
using iobuf_get when possible and use memchr to find '\n'. This
speeds armored decryption.

Benchmark results below, tested on Intel Core i7-4790K (turbo off).
Encrypted 2 GiB through pipe to ramfs file using AES128. Decrypt
ramfs file out through pipe to /dev/null.

before patch-set
----------------
               gpg process
armor:         user time    pipe transfer rate
 encrypt-aead:  13.8         140 MB/s
 decrypt-aead:  30.6         68 MB/s
 encrypt-cfb:   17.4         114 MB/s
 decrypt-cfb:   32.6         64 MB/s

after (decrypt+iobuf opt)
-------------------------
               gpg process
armor:         user time    pipe transfer rate
 decrypt-aead:  22.5         92 MB/s
 decrypt-cfb:   24.4         85 MB/s

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
2018-11-08 21:31:12 +02:00
..
2018-10-24 15:56:18 -04:00
2017-04-28 10:06:33 +09:00
2018-10-25 16:53:05 -04:00
2015-10-28 10:20:17 +01:00
2018-05-29 13:01:12 +02:00
2018-05-29 13:01:12 +02:00
2018-10-24 15:56:18 -04:00
2018-10-24 15:56:18 -04:00
2015-11-17 12:50:22 +01:00
2017-04-28 10:06:33 +09:00
2018-11-08 21:31:12 +02:00
2017-02-21 13:11:46 -05:00
2018-10-25 16:53:05 -04:00
2018-10-25 16:53:05 -04:00
2017-02-21 13:11:46 -05:00
2018-10-24 15:56:18 -04:00
2018-10-24 15:56:18 -04:00
2016-03-02 14:27:30 +01:00
2017-04-28 10:06:33 +09:00
2017-02-21 13:11:46 -05:00
2018-10-25 16:53:05 -04:00
2018-10-24 15:56:18 -04:00
2018-10-24 15:56:18 -04:00
2018-10-24 15:56:18 -04:00
2018-10-02 14:22:24 +09:00
2018-10-24 15:56:18 -04:00
2017-01-05 20:43:40 +01:00
2017-02-21 13:11:46 -05:00
2018-02-22 15:32:36 +01:00
2017-02-21 13:11:46 -05:00

Common functionality used by all modules of GnuPG.