TOFU performance / DB format

Neal H. Walfield neal at walfield.org
Fri Oct 23 23:22:51 CEST 2015


At Fri, 23 Oct 2015 21:10:41 +0200,
Werner Koch wrote:
> 
> On Fri, 23 Oct 2015 19:09, neal at walfield.org said:
> 
> > In 7f65e84, I added an interface to enable batch updates.  This was
> > based on the observation that SQLite performs better when there is a
> > single big transaction instead of many small transactions [1].  This
> 
> I have not looked at the patch but I assume that you now do a
> BEGIN_TRANSACTION and a single COMMIT at the end of the key listing
> instead of the default auto-commit mode.  Given that this is now a
> single large transaction, I wonder how the system behaves if several
> gpg instances start a Key listing at about the same time.
> Kleopatra is known for doing this in some cases.

If the DB is locked, I've configured sqlite to wait up to 5 seconds
before aborting.  Because there are situations where this might not be
enough, my plan to to drop, yield and then retake the big lock
occasionally.

> >   $ rm -rf tofu.d*; time  gpg2 --trust-mode=tofu --tofu-db-format=flat -k >/dev/null
> >   real	0m0.161s
> >   user	0m0.052s
> >   sys	0m0.004s
> 
> Now many keys?

518.

Thanks,

:) Neal



More information about the Gnupg-devel mailing list