Extension APIs should use defineLazyPreferenceGetter
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr78? fixed, thunderbird80 fixed)
People
(Reporter: standard8, Assigned: standard8)
Details
(Keywords: perf)
Attachments
(1 file)
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Review |
Some of the extension APIs are calling Services.prefs.get<>()
every time they are called. From experience elsewhere, it has been seen that the preference APIs can be quite slow, and it is better to cache those values.
XPCOMUtils.defineLazyPreferenceGetter
makes this easy for us, as it caches the values and handles any updates to those values automatically.
Doing this will help reduce the performance impact for add-ons that call various functions frequently, e.g. functions that return messages or a large amount of messages.
Of the current accesses, I think only doing the ext-mail.js and ext-mailTabs.js is probably ok. ext-cloudFile doesn't really fit (though it could cache the display name), ext-compose.js and ext-menus I think are unlikely to be hot paths.
Assignee | ||
Comment 1•4 years ago
|
||
Depends on D86452
Assignee | ||
Comment 2•4 years ago
|
||
I'm not entirely sure of the full impact here, I don't think it is major, but I'd still be looking at getting these uplifted to help generally with performance issues with WebExtensions.
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/comm-central/rev/1202539edcab
Use defineLazyPreferenceGetter to help performance of some of the WebExtension APIs. r=darktrojan
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Comment on attachment 9168983 [details]
Bug 1658116 - Use defineLazyPreferenceGetter to help performance of some of the WebExtension APIs. r?darktrojan!
[Approval Request Comment]
Regression caused by (bug #): Unknown.
User impact if declined: Probably only a small performance impact.
Testing completed (on c-c, etc.): Landed on c-c.
Risk to taking this patch (and alternatives if risky): Should be low - avoids re-fetching preferences every time certain WebExtension APIs are called.
Comment 5•4 years ago
|
||
Comment on attachment 9168983 [details]
Bug 1658116 - Use defineLazyPreferenceGetter to help performance of some of the WebExtension APIs. r?darktrojan!
[Triage Comment]
Approved for beta
Comment 6•4 years ago
|
||
bugherder uplift |
Thunderbird 80.0b3:
https://hg.mozilla.org/releases/comm-beta/rev/3d1e8c30e709
Comment 7•4 years ago
|
||
Comment on attachment 9168983 [details]
Bug 1658116 - Use defineLazyPreferenceGetter to help performance of some of the WebExtension APIs. r?darktrojan!
[Triage Comment]
Approved for esr78
Comment 8•4 years ago
|
||
bugherder uplift |
Thunderbird 78.1.2:
https://hg.mozilla.org/releases/comm-esr78/rev/aaa38c19a9df
Description
•