Closed Bug 1595618 Opened 5 months ago Closed 5 months ago

Optimization: Don't iterate all windows just to find SourceListeners on DeviceChange

Categories

(Core :: WebRTC: Audio/Video, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: jib, Assigned: jib)

References

Details

Attachments

(1 file)

From https://phabricator.services.mozilla.com/D52427#inline-319297:

I'm not sure whether you want to follow up with more work on this O(n^2) path here or in another patch, but I just had a thought about it and there is (plenty of) room for improvement.

When we reach here we have concluded that a device has been unplugged, and we want to stop the corresponding tracks for all SourceListeners that use them. So we iterate all windows because that would also cover all SourceListeners. (????!)

But but. We already know all SourceListeners -- they're in the GetUserMediaWindowListeners which are in mActiveWindows. Why don't we just iterate them instead? No checking of windows or docshells needed!

Assignee: nobody → jib
Pushed by jbruaroey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b21c6bc1e1c
Optimize SourceListener iteration on devicechange. r=pehrsons
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.