navigator.requestMediaKeySystemAccess > 1000x slowdown
Categories
(Core :: Audio/Video: Playback, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox123 | --- | unaffected |
firefox124 | --- | unaffected |
firefox125 | + | fixed |
People
(Reporter: thorin, Assigned: alwu)
References
(Regression)
Details
(Keywords: regression)
Attachments
(5 files)
moz-regression: Bug 1881620
STR:
- load about:blank
- paste js below into console and hit enter
- expected: e.g. 4ms
- got: 5000+ms
function test() {
let t0 = performance.now()
function exit(value) {
let t1 = performance.now()
console.log(t1 - t0, "ms", value)
}
const config = {
initDataTypes: ['cenc'],
videoCapabilities: [{
contentType: 'video/mp4;codecs="avc1.4D401E"'
}],
persistentState: "required"
}
navigator.requestMediaKeySystemAccess("org.w3.clearkey", [config]).then((key) => {
exit(true)
})
.catch(function(e){
exit("error")
})
}
test()
Reporter | ||
Updated•8 months ago
|
Comment 1•8 months ago
|
||
[Tracking Requested - why for this release]: A large noticeable performance regression.
Comment 2•8 months ago
|
||
Set release status flags based on info from the regressing bug 1881620
:alwu, since you are the author of the regressor, bug 1881620, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 3•8 months ago
|
||
There are some key system names are designed for hardware decryption
only in our implementation. When a website requests for a EME playback,
they could use those key systems but don't specifiy the robustness in
their config.
Therefore, for getting a precise result, we need to consider the key
system name together as well.
Assignee | ||
Comment 4•8 months ago
|
||
The primary reason of causing the performance bad is that we always
look up ALL key system configs even if some configs are apparently not
related with the request's key system. Especially it takes longer time
to request configs from MFCDM.
This patch allows us only check those configs related with the request's
key system name so that we won't need to spend time on unnecessary
configs.
Depends on D204682
Assignee | ||
Comment 5•8 months ago
|
||
Depends on D204683
Assignee | ||
Comment 6•8 months ago
|
||
Before we always query the capabilities from both software and hardware
decryption for every key system which WMFCDMImpl supports, now it should
only query the exact decryption state that we need.
Depends on D204712
Comment 7•8 months ago
|
||
The bug is marked as tracked for firefox125 (nightly). However, the bug still has low severity.
:jimm, could you please increase the severity for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.
For more information, please visit BugBot documentation.
Comment 8•8 months ago
|
||
Will this still be slow if the site is asking for playready?
Assignee | ||
Comment 9•8 months ago
|
||
Yes, but only for the first time, we will cache the result to avoid asking from CDM again.
Comment 10•8 months ago
|
||
(In reply to Alastor Wu [:alwu] from comment #9)
Yes, but only for the first time, we will cache the result to avoid asking from CDM again.
Does Edge have the same note?
Assignee | ||
Comment 11•8 months ago
|
||
What do you mean for the same note? do you mean if they cache the result as well, or do that spend similar time on asking CDM? It you test those JS code on Edge, the result will be quick. It will also take similar time for us after we cache the result from CDM, I am not sure if they already ask the result first before we calling the API.
--
Severity should still be S3, this can be fixed by turning off the pref media.wmf.media-engine.enabled
, and this is the Nightly only pref.
Comment 12•8 months ago
|
||
(In reply to Alastor Wu [:alwu] from comment #11)
What do you mean for the same note? do you mean if they cache the result as well, or do that spend similar time on asking CDM? It you test those JS code on Edge, the result will be quick. It will also take similar time for us after we cache the result from CDM, I am not sure if they already ask the result first before we calling the API.
--
Severity should still be S3, this can be fixed by turning off the prefmedia.wmf.media-engine.enabled
, and this is the Nightly only pref.
I don't know why I wrote "note". I meant to write "Does Edge have the same problem?" It sounds like they don't. I feel like a first run time of 5s is still too slow. I'll try to take a look at what Edge is doing today.
Assignee | ||
Comment 13•8 months ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #12)
I don't know why I wrote "note". I meant to write "Does Edge have the same problem?" It sounds like they don't. I feel like a first run time of 5s is still too slow. I'll try to take a look at what Edge is doing today.
Oh for sure, it won't need to take 5s after landing the fix. For a query to PlayReady, it would be less than 1s on my debug build for the first run, and it can definitely be improved more.
Assignee | ||
Comment 14•8 months ago
•
|
||
I'm currently working on a further improvement, and only do the minimum version of improvement on this bug in order to solve the problem because the full improvement takes more time.
Comment 15•8 months ago
|
||
Comment 16•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1fc2b6e3f660
https://hg.mozilla.org/mozilla-central/rev/bee288a5eec0
https://hg.mozilla.org/mozilla-central/rev/c963a060362f
https://hg.mozilla.org/mozilla-central/rev/64afd4092c58
Reporter | ||
Comment 17•8 months ago
|
||
verified fixed for clearkey - back to 5ms
Updated•7 months ago
|
Description
•