Closed Bug 1791130 Opened 2 years ago Closed 1 year ago

Fix underlying issue for S/MIME function being very slow (usually can't use them for suggesting encryption since that makes Thunderbird very slow)

Categories

(MailNews Core :: Security: S/MIME, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
thunderbird_esr102 --- fixed

People

(Reporter: mkmelin, Assigned: KaiE)

References

Details

(Keywords: perf)

Attachments

(2 files)

+++ This bug was initially created as a clone of Bug #1779613 +++

Bug 1779613 had to work around the S/MIME functions being slow by disabling the notification to suggest encryption if possible. mail.smime.remind_encryption_possible false.

We should fix the underlying issue so those functions work as they should.

Blocks: 1779613
No longer blocks: tb102found

We should check whether we are currently executing the test for available certificates multiple times (unintentionally).

I think we should introduce a cache for function checkRecipientKeys(), I think it's likely that will help.
Currently, we will re-test the full set of all recipients whenever any entry on to/cc/bcc is added or removed.

IMHO it isn't possible to skip automatic checking of available S/MIME certificates for the work in bug 135636.
Consequently I consider fixing this slowness as a blocker for bug 135636.

Blocks: 135636
Assignee: nobody → kaie
Status: NEW → ASSIGNED

The current code will repeat searching certificates for ALL receipients every time ANY change to the recipient list is made.

The patch makes the following changes to avoid that:

  • introduce a new helper function that does an S/MIME cert lookup for a single given email address
  • in composer, introduce a cache of already found and valid S/MIME certificates
  • perform validity checking of certificates at an earlier time (during initial lookup)

Soon, I want to offer an esr102 experimental binary with this change, and ask reporters of the original slowness to help us test this potential improvement. (But let's start with landing on c-c and c-beta.)

Flags: needinfo?(kaie)
Target Milestone: --- → 109 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/24ba662b649f
Speed up s/mime recipient certificate check. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Flags: needinfo?(kaie)

Everyone who has experienced (and can reproduce) the slow behavior:

Could you please help testing if this improvement helped a lot, helped just a little, or helped not at all to improve performance in your environment?

The easiest way to obtain a Thunderbird test binary with these fixes is using a Daily build. However, that involves using a separate profile.

If you'd prefer to test a compatible build based on the 102.x stable branch, you could download one of the following builds (for your platform), extract it, and then run thunderbird from that directory, ideally from a terminal window, giving parameter -P, to allow you to use your existing profile that you're currently using with 102.x

These following builds should not create any problems for your existing 102.x profile, and you should be able to go back to regular stable 102.x builds after testing this experimental build.

Linux 64bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/UfPilbciRwuKErH-zxVapg/runs/0/artifacts/public/build/target.tar.bz2

Linux 32bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/QZAacYW_SzCowLJAcKMj2A/runs/0/artifacts/public/build/target.tar.bz2

Windows 64bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/DZYdd6XzRqmNzEbgTotL7g/runs/0/artifacts/public/build/target.zip

Windows 32bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/VDmzKz3vR1SHlpi2h82xoQ/runs/0/artifacts/public/build/target.zip

(build with patch:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=c076a7874c1d050dbb2fe8e2287e0716e7c11919 )

Hello, I wasn't aware that most users don't have permission to add commnents to a closed bug (like this one).

If you are able to provide any feedback regarding my request for testing, please send me email to kaie@kuix.de - thanks in advance!

Blocks: 1808295

I have received exactly one test report, from chriechers, who confirmed the fix is helping - thank you!

The fix has been part of 109 beta, and I haven't seen any regression reports.

I nominate this for 102 uplift (but not yet bug 1808295).
Once this is uplifted, we could ask again that people test by enabling the pref in the official build, prior to making the landing decision for bug 1808295.

Comment on attachment 9306655 [details] [diff] [review]
1791130-esr102.patch

[Approval Request Comment]
Regression caused by (bug #): 1771122
User impact if declined: encryption reminder incomplete
Testing completed (on c-c, etc.): beta 109
Risk to taking this patch (and alternatives if risky): low, because this code is preffed of by default

Attachment #9306655 - Flags: approval-comm-esr102?

Comment on attachment 9306655 [details] [diff] [review]
1791130-esr102.patch

[Triage Comment]
approved for esr102

Attachment #9306655 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: