diff options
author | Werner Koch <wk@gnupg.org> | 2015-06-20 15:03:32 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2015-06-20 15:03:32 +0200 |
commit | 6500f338a35f4148606480c79f3a0c1b0d15f13a (patch) | |
tree | 704099c6494b66b97edaeee63e18fea0012701c0 /g10/keydb.h | |
parent | gpg: Add more log_clock calls to keydb.c (diff) | |
download | gnupg2-6500f338a35f4148606480c79f3a0c1b0d15f13a.tar.xz gnupg2-6500f338a35f4148606480c79f3a0c1b0d15f13a.zip |
gpg: Improve speed of --check-sigs and --lish-sigs.
* g10/keydb.c (kid_list_t): New.
(kid_not_found_table, n_kid_not_found_table): New.
(kid_not_found_p, kid_not_found_insert, kid_not_found_flush): New.
(keydb_insert_keyblock): Flush the new cache.
(keydb_delete_keyblock): Ditto.
(keydb_update_keyblock): Ditto.
(keydb_search): Use the new cache.
(keydb_dump_stats): New.
* g10/gpg.c (g10_exit): Dump keydb stats.
--
What we do here is to keep track of key searches by long keyids (as
stored in all signatures) so that we do not need to scan the keybox
again after we already found that this keyid will result in
not-found. As soon as we change gpg to run as a co-process we should
store this table per session because other instances of gpg may have
updated the keybox without us knowing.
On a test ring with
gpg: 94721 good signatures
gpg: 6831 bad signatures
gpg: 150703 signatures not checked due to missing keys
gpg: 5 signatures not checked due to errors
gpg: keydb: kid_not_found_table: total: 14132
this new cache speeds a --check-sigs listing up from 28 minutes to
less than 3 minutes.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keydb.h')
-rw-r--r-- | g10/keydb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/g10/keydb.h b/g10/keydb.h index 0e3816f1d..1aa4e0e2f 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -132,6 +132,7 @@ union pref_hint #define KEYDB_RESOURCE_FLAG_READONLY 8 /* Open in read only mode. */ gpg_error_t keydb_add_resource (const char *url, unsigned int flags); +void keydb_dump_stats (void); KEYDB_HANDLE keydb_new (void); void keydb_release (KEYDB_HANDLE hd); @@ -154,6 +155,7 @@ gpg_error_t keydb_search_next (KEYDB_HANDLE hd); gpg_error_t keydb_search_kid (KEYDB_HANDLE hd, u32 *kid); gpg_error_t keydb_search_fpr (KEYDB_HANDLE hd, const byte *fpr); + /*-- pkclist.c --*/ void show_revocation_reason( PKT_public_key *pk, int mode ); int check_signatures_trust( PKT_signature *sig ); |