[Psi-Devel] Bug#450736: psi: Sending GPG-encrypted messages is delayed by 4 seconds
Justin Karneges
justin-psi2 at affinix.com
Mon Nov 12 15:24:03 PST 2007
On Monday 12 November 2007 2:37 pm, Christoph Haas wrote:
> Jan,
>
> On Mon, Nov 12, 2007 at 11:19:03PM +0100, Jan Niehusmann wrote:
> > On Fri, Nov 09, 2007 at 08:28:39PM +0100, Christoph Haas wrote:
> > > When enabling GPG encryption and sending a message it takes 4 seconds
> > > until the message gets sent. During that time the program is
> > > unresponsive. This does not happen when sending messages without
> > > encryption. This also did not happen with Psi 0.10.
> >
> > I forwarded the report upstream (see
> > http://lists.affinix.com/pipermail/psi-devel-affinix.com/2007-November/00
> >7502.html), and it seems like other people had similar issues. The cause
> > is not yet known, though.
>
> Thanks for forwarding.
>
> > Please also not the posting at
> > http://lists.affinix.com/pipermail/psi-devel-affinix.com/2007-November/00
> >7542.html where Justin is asking for some clarification.
>
> As a test I just downgraded Psi to 0.10-3 again while leaving everything
> else identical on my system. The delay was gone. If I send myself a
> message without encryption there is no noticable delay. Enabling
> encryption adds a hardly noticeable delay of ~200ms. But that's nothing
> compared to 4s with version 0.11.
>
> So I suspect it's the way that 0.11 calls gnupg. I don't think the
> "blocked UI" issue should be fixed - rather the cause for the delay
> making encryption take ~20 times longer. I'm running on gnupg 1.4.6 with
> gnupg-agent 2.0.7 here.
>
> Thanks for taking care of the bug.
Hmm, I think I know what is happening. qca-gnupg is very slow with keyid
lookups. It hits gpg --list-keys whenever you do anything at all, and that
can really slow things down, particularly if you have a large keyring. I
think a lookup happens for every encrypted message. These key lookups are
performed synchronously, which explains the frozen UI.
In Psi 0.10, the gpg keys were in-memory cached and the keyring files were
monitored for changes (with --list-keys only called if a change is detected),
which is a far more efficient approach. qca-gnupg is based on Psi 0.10's gpg
code, but as is common with a lot of our Psi 0.11 Qt 3 -> Qt 4 porting, many
things got lost in the transition.
Solving this problem is a matter of optimizing qca-gnupg, which fortunately
can be done independent of Psi now that the code is separated out into a
plugin.
-Justin
More information about the Psi-Devel
mailing list