Page MenuHome GnuPG

Bad performance of gpg -K when have a lot of keys with keyboxd
Closed, ResolvedPublic


When I try gpg -K with my keyring (8744 keys), I found it costs 2.4s to query, but if I query my name, it only costs 0.2s. As keyboxd uses sqlite as the backend, it should have a similar performance. So I checked the source code. And then I found GnuPG never used the SQL query directly when gpg -K. It queries an OpenPGP key and uses the NEXT command to query the next key until it reaches the end. So GnuPG isn't querying, but is, instead, traversing.



Event Timeline

werner claimed this task.
werner edited projects, added Not A Bug, gnupg; removed Bug Report.
werner added a subscriber: werner.

That's right: -K is merely a -k which prints only keys which have at least one secret key or a stub key (for smartcards) available.