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

Guilhem Moulin guilhem at
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:
> 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
and 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/]
    2,251,439,456  ???:_gcry_mpi_scan [/lib/i386-linux-gnu/]
    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/]
      742,384,639  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_malloc [/lib/i386-linux-gnu/i686/cmov/]
      497,838,818  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_free [/lib/i386-linux-gnu/i686/cmov/]
      405,209,527  ???:_gcry_md_block_write [/lib/i386-linux-gnu/]

    gpg2 --homedir /tmp/gnupg2 --with-colons --list-sigs 0x39278DA8109E6244
    542,468,568  ???:0x0002d4a0 [/usr/bin/gpg2]
    383,560,000  ???:0x0006c920 [/lib/i386-linux-gnu/]
    325,177,890  ???:_gcry_mpi_scan [/lib/i386-linux-gnu/]
    293,168,038  /build/glibc-jhsZw7/glibc-2.19/string/../sysdeps/i386/i686/multiarch/../memcpy.S:__GI_memcpy [/lib/i386-linux-gnu/i686/cmov/]
    276,299,702  /build/glibc-jhsZw7/glibc-2.19/malloc/malloc.c:_int_malloc [/lib/i386-linux-gnu/i686/cmov/]
    262,348,939  /build/glibc-jhsZw7/glibc-2.19/string/../sysdeps/i386/i686/multiarch/../mempcpy.S:__GI_mempcpy [/lib/i386-linux-gnu/i686/cmov/]
    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/]
    145,235,430  ???:0x0006c8d8 [/lib/i386-linux-gnu/]
    102,452,710  /build/glibc-jhsZw7/glibc-2.19/libio/getc.c:getc [/lib/i386-linux-gnu/i686/cmov/]

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

-------------- 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