getNewSideloads checks for system add-ons last modified time on the main thread at the end of startup
Categories
(Toolkit :: Add-ons Manager, enhancement)
Tracking
()
People
(Reporter: florian, Unassigned, NeedInfo)
References
Details
(Keywords: main-thread-io, perf, Whiteboard: [fxperf:p3])
See this profile: https://bit.ly/2WGJr18
Accessing .lastModifiedTime
on an nsIFile object causes a stat call on the main thread, which blocks the UI.
The stack is:
promise callback []
AsyncFunctionNext [self-hosted:693:26]
InterpretGeneratorResume [self-hosted:1153:33]
_checkForSideloaded [resource:///modules/ExtensionsUI.jsm:75:27]
getNewSideloads [resource://gre/modules/AddonManager.jsm:3497:17]
getNewSideloads [resource://gre/modules/addons/XPIProvider.jsm:2987:23]
scanForChanges [resource://gre/modules/addons/XPIProvider.jsm:1413:16]
getModTime [resource://gre/modules/addons/XPIProvider.jsm:578:12]
getNewSideloads
is already an async function, so we would need an async code path in scanForChanges
and then getModTime
could be done using OS.File.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
A challenge here is that this code can be called at different times during startup. In a "regular" startup this is not called until after first paint. But in a new profile or after an application update, this code is called from XPIProvider.startup() -> XPIProvider.checkForChanges -> XPIProvider.scanForChanges(). If we switch this code to use OS.File then we're adding another user of osfile before first paint which we've been trying to avoid (bug 1522955)
Comment 2•5 years ago
|
||
(In reply to Andrew Swan [:aswan] from comment #1)
If we switch this code to use OS.File then we're adding another user of osfile before first paint which we've been trying to avoid (bug 1522955)
Looks like this was meant to be bug 1522925.
Comment 3•2 years ago
|
||
Now that we have IOUtils support, we could use that instead of OS.File.
However, getModTime is also called in XPIState.syncWIthDB and XPIStateLocation.addFile, both of which have deep sync stacks. This would require asyncifying a lot of XPIDatabase and XPIProvider
Updated•2 years ago
|
Description
•