mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
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>
This commit is contained in:
parent
53e9b86085
commit
6500f338a3
3 changed files with 101 additions and 0 deletions
|
@ -4361,8 +4361,10 @@ g10_exit( int rc )
|
|||
gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE);
|
||||
if (DBG_CLOCK)
|
||||
log_clock ("stop");
|
||||
|
||||
if ( (opt.debug & DBG_MEMSTAT_VALUE) )
|
||||
{
|
||||
keydb_dump_stats ();
|
||||
gcry_control (GCRYCTL_DUMP_MEMORY_STATS);
|
||||
gcry_control (GCRYCTL_DUMP_RANDOM_STATS);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue