GMP initialization does main thread I/O at startup
Categories
(Core :: Audio/Video: GMP, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox76 | --- | affected |
People
(Reporter: aswan, Assigned: emalysz)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxperf:p2])
Attachments
(1 file)
When the addon manager starts up, GMP is initialized here-ish:
https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/toolkit/mozapps/extensions/internal/GMPProvider.jsm#589
The first reference to the gmp service initializes it which leads to main thread I/O here:
https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/dom/media/gmp/GMPServiceParent.cpp#217
Ideally we would defer all this work until at least after the first paint of the browser UI.
| Reporter | ||
Comment 1•2 years ago
|
||
Chris, I picked you at random from people who have touched GMP code recently. Is it feasible to delay GMP initialization as described above?
Comment 2•2 years ago
|
||
We can probably defer this to after first paint. It needs to happen before we start loading pages, as said pages may try to use GMPs, and fail if we've not initialized the GMPs.
Comment 3•2 years ago
|
||
Could we also move the I/O off main thread?
Comment 4•2 years ago
|
||
Chris, I made a guess at the priority here, I'll let you have a go at this if you feel it's important.
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
Pushed by rmaries@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2c6d8b14baf7 delay GMP initialization until after first point to improve perceived performance. r=mconley
Comment 7•1 year ago
|
||
| bugherder | ||
Comment 8•1 year ago
|
||
Here is a startup profile on the 2018 ref hardware captured on today's Nightly. The view is zoomed to start at the end of the early blank paint, and stop after first paint of the browser UI (right before we initialize NSS) https://bit.ly/2ybWoWz
The load of GMPProviders.jsm is in this range, and the main thread I/O triggered by it is later within the range, when we start the Privileged Content process. Nothing changes on screen during this range, so re-ordering things inside it will have no user-impact.
Description
•