Re: gpg and trustdb very slow
On Sat, 22 Sep 2001, Karsten M. Self wrote:
> on Tue, Sep 18, 2001 at 08:37:33AM -0300, Henrique de Moraes Holschuh (email@example.com) wrote:
> > On Tue, 18 Sep 2001, Christian Kurz wrote:
> > > On 01-09-18 Joey Hess wrote:
> > > > It'd be nice if someone would look at optimizing it sometime; the
> > > > behavior I see with strace is absurd, and could easily be done with no
> > > > syscalls, at least, by just reading the whole trustdb into memory.
> > >
> > > I know that the Werner revamped the whole keyring code about 1 or two
> > > weeks ago. I just tried the --list-keys with my private and the debian
> > > keyring specified in the options file and I didn't took more then 5
> > > minutes for me. (AMD K6-200). So I don't think if anyone would really
> > > want to optimize the code more, he should look at the current cvs code.
> > As well as reading the docs, where it is said that one must reinsert
> > all keys in the trustdb to take advantage of a new caching
> > algorithm...
> Could you point us to the relevant docs and/or the command for
> re-reading keys?
Nope, I have no idea where the hell I read that. I'd try the changelogs of
upstream and the Debian package, however: that rings a bell on my mind.
As for the useful information, that I can help you with. All you have to do
is to let gnupg readd all your keys to a keyring (as in 'new insertions to a
keyring are made in the new cache scheme'). Simple enough to do with any RW
keyrings you might have:
1. move every keyring out of the way, including the RO ones.
2. feed a keyring to gnupg. You might want to use --fast-import followed by
an --update-trustdb for that.
3. replace the old keyring you fed gnupg with with the new one
4. repeat as needed.
I actually find it better to have just one RW keyring, and feed any RO
keyrings I might need (such as Debian's) to gnupg to get them added to that
RW keyring. Since gnupg's handling of multiple keyrings is not really that
hot, keeping track of only a simple RW keyring helps a lot.
Hmm, sorry about that. I sounded far more annoyed/annoying ;) than I should
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot