Remove costly atomic reference counting in ProduceDataForStreamsBlockByBlock()

RESOLVED FIXED in mozilla29

Status

()

Core
Web Audio
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: karlt, Assigned: karlt)

Tracking

({perf})

Trunk
mozilla29
x86_64
Linux
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
MediaStream reference counting in ProduceDataForStreamsBlockByBlock() is
showing up as at least 2%, maybe as much as 3%, of MSG thread CPU usage in JProf profiles while in Jam mode on http://www.cappel-nord.de/webaudio/acid-defender/

(In reply to :Ehsan Akhgari (needinfo? me!) from bug 864709 comment #20)
> So one threading race condition that I can see here is that when we call
> MediaStreamGraphImpl::ProduceDataForStreamsBlockByBlock, we do not hold a
> strong reference to the media stream, so we have no guarantee for the stream
> (and therefore the engine) to not die when we're in a call to
> ProduceAudioBlock, if the cycle collector frees the node object on the main
> thread.

mStreams holds a strong reference.

Elements are only added or removed from mStreams in response to control
messages from the main thread or during UpdateStreamOrder().
Neither of these events will happen during ProduceDataForStreamsBlockByBlock().
(Assignee)

Comment 1

4 years ago
Created attachment 8355938 [details] [diff] [review]
less.block.ref.counting
Attachment #8355938 - Flags: review?(paul)

Updated

4 years ago
Attachment #8355938 - Flags: review?(paul) → review+
(Assignee)

Comment 2

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/3749f33287c4
Flags: in-testsuite-

Comment 3

4 years ago
https://hg.mozilla.org/mozilla-central/rev/3749f33287c4
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.