Closed Bug 2086107 Opened 20 days ago Closed 20 days ago

1328.68 - 393.87% media-capabilities worker-decode-file-video-avc-hot + 3 more (Linux, Windows) regression on Wed October 21 2026

Categories

(Core :: Audio/Video, defect)

defect

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox-esr153 --- unaffected
firefox159 --- unaffected
firefox160 --- affected
firefox161 --- affected

People

(Reporter: performance-sheriff-bot, Unassigned)

References

(Regression)

Details

(Keywords: perf, perf-alert, regression)

Perfherder has detected a browsertime performance regression from push 6fa3eb08b69fb2451473fd578b4fe832edcd84a9. As author of one of the patches included in that push, we need your help to address this regression.

Please acknowledge, and begin investigating this alert within 3 business days, or the patch(es) may be backed out in accordance with our regression policy.

Regression Test Platform Options Absolute values [old vs new] Performance Profiles
1329% media-capabilities worker-decode-file-video-avc-hot (doc) windows11-64-24h2-shippable fission webrender 2.95 -> 42.08 Before/After
841% media-capabilities worker-decode-file-video-avc-cold (doc) windows11-64-24h2-shippable fission webrender 4.04 -> 38.04 Before/After
727% media-capabilities worker-decode-file-video-avc-hot (doc) linux2404-64-shippable fission webrender 4.53 -> 37.42 Before/After
394% media-capabilities worker-decode-file-video-avc-cold (doc) linux2404-64-shippable fission webrender 3.45 -> 17.05 Before/After

Support & Actionable Steps

For questions, please contact acseh@mozilla.com. You can also find help on Slack (#perf-help) or Matrix (#perftest).

Action guide details:

Flags: needinfo?(aosmond)

Set release status flags based on info from the regressing bug 2082607

I ran locally and agree with the regression window. However the benchmark was misleading.

In the past, if we did not have a TextureFactoryIdentifier available, which appears can happen very early in startup, the content process would send an empty one:
https://searchfox.org/firefox-main/rev/5838a8b86148afdd3f0be3f34e440d489434fe69/dom/media/ipc/RemoteMediaManagerChild.cpp#466-469

On the remote side in the RDD/GPU processes, we would then fail to create mKnowsCompositor:
https://searchfox.org/firefox-main/rev/5838a8b86148afdd3f0be3f34e440d489434fe69/dom/media/ipc/RemoteVideoDecoder.cpp#175-182

And the lack of mKnowsCompositor would change nothing, so it would create the decoder right away:
https://searchfox.org/firefox-main/rev/5838a8b86148afdd3f0be3f34e440d489434fe69/dom/media/ipc/RemoteVideoDecoder.cpp#195-198

The consequence of this is that you can only get software decoding, where the RDD would feed the decoder frames directly into the content process and then content would copy/forward those to the compositing process. This is the exact scenario my patches were designed to avoid.

The fact that the probe hits it means it would find no HW support. So presumably the power efficient / etc metrics are all wrong in the benchmark.

What happens now is the content process doesn't know anything about the TextureFactoryIdentifier:
https://searchfox.org/firefox-main/rev/d9098b3e11c2fbc2b2d84e53a3c784814cbdab3e/dom/media/ipc/RemoteMediaManagerChild.cpp#503-505

Now when we try to create the decoder, it first makes sure we wait for the compositing process to be up:
https://searchfox.org/firefox-main/rev/d9098b3e11c2fbc2b2d84e53a3c784814cbdab3e/dom/media/ipc/RemoteVideoDecoder.cpp#187-201

Then it requests the TextureFactoryIdentifier from the compositing process:
https://searchfox.org/firefox-main/rev/d9098b3e11c2fbc2b2d84e53a3c784814cbdab3e/dom/media/ipc/RemoteVideoDecoder.cpp#215-227

And only then can the decoder be constructed with the known compositing/hardware support state. These extra round trips don't actually cause the delay. What causes the delay is the fact that we create the HW decoder at the time the decoder is constructed:
https://searchfox.org/firefox-main/rev/d9098b3e11c2fbc2b2d84e53a3c784814cbdab3e/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp#995

We do this because we only support falling back between PDMs if we fail to construct the decoders. If HW decoders fail to initialize, we want to fall back to the software PDMs. We only know if it will fail if we try to initialize first.

So in brief: We regressed because now we are actually trying to create HW decoders in the probe and are now paying the cost to initialize them. Before the probe was wrong and only reported SW support.

So I acknowledge the regression as being caused by my bug, but my bug fixes a correctness issue with the benchmark, and so we cannot back it out to fix the benchmark. The benchmark was wrong.

I don't have a solution to improve the benchmark given this reality. The probe initializes the decoders, so even if we moved the HW init from RecvConstruct to RecvInit, it wouldn't improve performance.

Status: NEW → RESOLVED
Closed: 20 days ago
Flags: needinfo?(aosmond)
Resolution: --- → WONTFIX

Also there might be an open question as to why the hot numbers are worse than the cold. I am not certain, but I suspect that the freeing of HW context interferes with the next run.

It appears that this code always returns nullptr when running on a worker, which is how we were only reporting SW capabilities in a worker:
https://searchfox.org/firefox-main/rev/d9098b3e11c2fbc2b2d84e53a3c784814cbdab3e/dom/media/mediacapabilities/MediaCapabilities.cpp#1811-1834

You need to log in before you can comment on or make changes to this bug.