Reddit Enhancement Suite 5.14.5 is ten times slower loading batched options with ExtensionStorageIDB.enabled
Categories
(WebExtensions :: Developer Outreach, defect, P3)
Tracking
(firefox-esr60 unaffected, firefox66 wontfix, firefox67 wontfix, firefox68 wontfix)
| Tracking | Status | |
|---|---|---|
| firefox-esr60 | --- | unaffected |
| firefox66 | --- | wontfix |
| firefox67 | --- | wontfix |
| firefox68 | --- | wontfix |
People
(Reporter: ke5trel, Unassigned)
References
()
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
STR:
- Install Reddit Enhancement Suite extension.
- Go to https://old.reddit.com/r/all
- Refresh page and take note of how long it takes for the icons under each post to change from a play arrow to a camera.
- Do the same thing with
extensions.webextensions.ExtensionStorageIDB.enabled = false.
With ExtensionStorageIDB enabled there is a 500ms delay before the extension style is applied which can be measured in screen captures and performance recordings.
Comment 2•7 years ago
|
||
(In reply to Kestrel from comment #0)
Created attachment 9055082 [details]
Performance comparisonSTR:
- Install Reddit Enhancement Suite extension.
- Go to https://old.reddit.com/r/all
- Refresh page and take note of how long it takes for the icons under each post to change from a play arrow to a camera.
- Do the same thing with
extensions.webextensions.ExtensionStorageIDB.enabled = false.With ExtensionStorageIDB enabled there is a 500ms delay before the extension style is applied which can be measured in screen captures and performance recordings.
Can you tell us some specs about your machine and whatever else might be affecting performance (other extensions, running programs, etc)? I'd like to get QA to reproduce this, but want to baseline performance considerations.
Comment 3•7 years ago
|
||
(This bug will be closed in next week's triage if there is still no response.)
Updated•7 years ago
|
Updated•7 years ago
|
The delay is best measured between the extension's loadOptions and beforeLoad which occur sequentially (filter Javascript call tree for "storage"). Measured with performance capture, the time to load options for the old storage method was 80ms and with the new method it is 900ms.
foreground.entry.js:38860
const beforeLoad = loadOptions.then(() => _runModuleStage('beforeLoad'));
Comment 5•7 years ago
|
||
The priority flag is not set for this bug.
:ddurst, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•7 years ago
|
Comment 6•7 years ago
|
||
Can we get a link to that profile? That's more helpful than the picture.
Another user has also noticed this regression:
https://www.reddit.com/r/firefox/comments/b3p7x8/firefox_660_extensions_performance_is_noticeable/
Updated•7 years ago
|
Comment 8•7 years ago
|
||
I took an initial look to the profiling report linked in comment 7 and gave it a try locally, but I'm wondering if there is any particular set of configurations for the RES extension that I may need to set to be able to reproduce it locally (and then properly compare it with what have been experienced by the reporter with and without the IDB backend).
In the meantime I've applied the following small change locally (to get a console.time/timeEnd log restricted to the content script code mentioned in comment 4):
diff -u reddit-enhanced-orig/foreground.entry.js reddit-enhanced/foreground.entry.js
--- reddit-enhanced-orig/foreground.entry.js 1979-12-31 00:00:00.000000000 +0100
+++ reddit-enhanced/foreground.entry.js 2019-05-20 18:53:25.289735895 +0200
@@ -37978,7 +37978,14 @@
const onInit = loadI18n.then(() => _runModuleStage('onInit', {
skipEnabledCheck: true
}));
-const init_loadOptions = onInit.then(() => Promise.all([_loadModuleOptions(), _loadModulePrefs()]));
+const init_loadOptions = onInit.then(() => {
+ console.time("TIMER init_loadOptions");
+ let res = Promise.all([_loadModuleOptions(), _loadModulePrefs()]);
+ res.then(() => {
+ console.timeEnd("TIMER init_loadOptions");
+ });
+ return res;
+});
const addModuleBodyClasses = init_loadOptions.then(() => _addModuleBodyClasses());
const init_always = init_loadOptions.then(() => _runModuleStage('always', {
skipEnabledCheck: true
@@ -38007,4 +38014,4 @@
establish(init_contentStart);
and then I loaded https://old.reddit.com/r/all in a tab with the modified extension installed and the extensions.webextensions.ExtensionStorageIDB.enabled pref set to both true and false, but the time logged by the call to console.timeEnd wasn't actually that different:
extensions.webextensions.ExtensionStorageIDB.enabled = false: 134ms for the first page load and ~70-80ms for the other loads.extensions.webextensions.ExtensionStorageIDB.enabled = true: 86ms for the first page load and ~70-80ms for the other loads.
and so it seems that, to be able to reproduce the visible lag as the reporter experienced, we may have to ensure that the scenario we are testing is actually similar enough to the one from the reporter, e.g.
- extensions configuration that we may have to set
- specs of the machine were the issue have been noticed (as David mentioned in comment 2)
It may be also helpful to collect a profile with ExtensionStorageIDB.enabled set to false to see if we may notice differences between the profiles collected that may point us to the right direction.
Comment 9•7 years ago
|
||
Filed this to the RES support reddit (https://www.reddit.com/r/RESissues/comments/bsmakf/res_for_firefox_reddit_enhancement_suite_10_times/) on May 24, 2019.
| Reporter | ||
Comment 10•7 years ago
|
||
Testing was done with a clean profile and default RES settings with 6x3Ghz cores.
I can confirm the latest version of RES now works the same with IDB backend enabled (time measured using supplied patch). I went back to RES 5.14.5 and was able to reproduce the problem, updating to RES 5.16.1 fixed it.
Most likely fix commit:
init: Don't batch loading of options
Loading multiple items together can be so slow that RES doesn't initalize (adding option body classes, custom styles etc) before Firefox decides to paint the first frame, causing a FOUC.
Comment 11•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Description
•