GloDa indexing messages smashes the address book
Categories
(MailNews Core :: Database, defect, P1)
Tracking
(thunderbird_esr78+ fixed, thunderbird82 fixed)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
(Keywords: regression)
Attachments
(3 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1669872 - Create a cached function which calls cardForEmailAddress on all directories. r?mkmelin
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78-
|
Details | Review |
16.36 KB,
patch
|
rjl
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
For every message GloDa indexes, and every email address in that message, it asks the address book to find a contact. In the worst case if there is no such contact, every directory must look through its entire database to find nothing.
In this bug I'm going to cache the results of the lookup so that when the same address is looked up a second time the address book is not hit. Given that this cache will collect every address ever seen (whether or not it's in the address book, and whether or not the address will ever be seen again) I'll clear the cache when GloDa stops indexing.
Assignee | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
I didn't do a benchmark of try build vs beta, but results seem positive - tested with my luwsm account, 5k message inbox, very responsive, message bodies display quickly, even though activity manager shows indexing is still in progress. (but potentially my results skewed by using phone hotspot - a temporary situation)
Assignee | ||
Updated•5 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/6171c903abd1
Try to avoid using the address book database when indexing messages. r=mkmelin
Comment 4•5 years ago
|
||
I just fired up my "production" beta profile with the try build. It is definitely better.
What other locations likely use AB lookup that may see significant performance impact? Filters? Calendar? Any addons?
Assignee | ||
Comment 5•5 years ago
•
|
||
Oh yuck, I suspect this code is pretty hot too, and it does almost exactly what the GloDa code does. Maybe I should generalise what I've done in this bug and put it somewhere more useful.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
This is more general than the previous version so that other code can call it too. I also realised with the 60s time out, waiting for Gloda to idle was unnecessary.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Big improvement to open it up to other callers but why not make this cache permanent? Maintenance on a card change is very simple; just add those listeners and replace/add/delete the cache entry. That is the most performant and best practices way to do it. Doubt memory is an issue (but it could be modeled).
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/2efdb12bede3
Create a cached function which calls cardForEmailAddress on all directories. r=mkmelin
Assignee | ||
Comment 9•5 years ago
|
||
Comment on attachment 9180659 [details]
Bug 1669872 - Create a cached function which calls cardForEmailAddress on all directories. r?mkmelin
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Lots of slow things
Testing completed (on c-c, etc.): On c-c since last week
Risk to taking this patch (and alternatives if risky): Not much, this is just a cache, and it's only used in places where 100% accuracy isn't critical.
The other patch in this bug will need to land first, but it's almost entirely wiped out by this patch, so it'd probably be tidier if they were rolled together.
Comment 10•5 years ago
|
||
Comment on attachment 9180659 [details]
Bug 1669872 - Create a cached function which calls cardForEmailAddress on all directories. r?mkmelin
[Triage Comment]
Approved for beta
Comment 11•5 years ago
|
||
As suggested, this is the combined version of the two patches that landed on comm-central, intended for uplift.
[Triage Comment]
Previous un-combined version approved by wsmwk.
Comment 12•5 years ago
|
||
bugherder uplift |
Thunderbird 82.0b3:
https://hg.mozilla.org/releases/comm-beta/rev/a3e7a88b857f
Comment 13•5 years ago
|
||
Comment on attachment 9181038 [details] [diff] [review]
1669872-gloda_cache_functions_COMBINED.patch
[Triage Comment]
Approved for esr78 (I assume combined is also what is wanted for esr)
Comment 14•5 years ago
|
||
bugherder uplift |
Thunderbird 78.4.0:
https://hg.mozilla.org/releases/comm-esr78/rev/24f92319c043
Comment 15•5 years ago
|
||
Comment on attachment 9180659 [details]
Bug 1669872 - Create a cached function which calls cardForEmailAddress on all directories. r?mkmelin
[Triage Comment]
for 78 we used attachment 9181038 [details] [diff] [review] 1669872-gloda_cache_functions_COMBINED.patch
Description
•