gpg --list-keys performance [was: Re: GnuPG 2.1.2 making tons of syscalls]

Guilhem Moulin guilhem at fripost.org
Wed Apr 1 16:50:23 CEST 2015


On Tue, 31 Mar 2015 at 18:43:35 -0400, Daniel Kahn Gillmor wrote:
> I also see that you've opened a related bug report here:
> 
> https://bugs.g10code.com/gnupg/issue1710
> 
> maybe it would be good to file separate bug reports for each specific
> issue so we can track them down?  the TL;DR of your initial post had a
> number of good independent details.

Thanks for the suggestion.  I filed https://bugs.g10code.com/gnupg/issue1938
and https://bugs.g10code.com/gnupg/issue1939 for the other two points of
my initial mail.

> Have you tried profiling the extremely slow invocations with "valgrind
> --tool=callgrind" ?  that might yield some hints about where to start
> fixing the problem.

After a quick look (have to improve my debugging skills I'm afraid :-P)

    gpg2 --homedir /tmp/gnupg1 --with-colons --list-sigs 0x39278DA8109E6244
    8,581,286,919  ???:0x00030690 [/usr/bin/gpg2]
    3,747,695,772  ???:0x0002d4a0 [/usr/bin/gpg2]
    3,714,625,963  ???:_transform [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]
    2,251,439,456  ???:_gcry_mpi_scan [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]
    1,812,455,446  ???:0x00092930 [/usr/bin/gpg2]
      979,689,330  ???:0x00033530 [/usr/bin/gpg2]
      845,059,243  ???:do_get_buffer [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]
      742,384,639  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_malloc [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]
      497,838,818  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_free [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]
      405,209,527  ???:_gcry_md_block_write [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]


    gpg2 --homedir /tmp/gnupg2 --with-colons --list-sigs 0x39278DA8109E6244
    542,468,568  ???:0x0002d4a0 [/usr/bin/gpg2]
    383,560,000  ???:0x0006c920 [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]
    325,177,890  ???:_gcry_mpi_scan [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]
    293,168,038  /build/glibc-jhsZw7/glibc-2.19/string/../sysdeps/i386/i686/multiarch/../memcpy.S:__GI_memcpy [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]
    276,299,702  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_malloc [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]
    262,348,939  /build/glibc-jhsZw7/glibc-2.19/string/../sysdeps/i386/i686/multiarch/../mempcpy.S:__GI_mempcpy [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]
    182,778,924  ???:0x0008fda0 [/usr/bin/gpg2]
    181,082,759  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_free [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]
    145,235,430  ???:0x0006c8d8 [/lib/i386-linux-gnu/libgcrypt.so.20.0.3]
    102,452,710  /build/glibc-jhsZw7/glibc-2.19/libio/getc.c:getc [/lib/i386-linux-gnu/i686/cmov/libc-2.19.so]

I guess I must compile gpg with debugging symbols to get proper
functions names, but these billions calls are somewhat scary :-P

-- 
Guilhem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: </pipermail/attachments/20150401/bb5e34cd/attachment.sig>


More information about the Gnupg-devel mailing list