remove unnecessary tracks from AudioNodeStreams

RESOLVED FIXED in Firefox 44

Status

()

defect
P1
normal
Rank:
5
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: karlt, Assigned: karlt)

Tracking

43 Branch
mozilla44
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(6 attachments)

Assignee

Description

4 years ago
Managing the track appears to be a significant part of overhead of processing.
See FindTrack() and AdvanceOutputSegment() in bug 1205540 comment 1.
Non-external audio nodes should not need a track at all.
Assignee

Comment 1

4 years ago
The distribution of MSG thread processing time from perf top -t <tid> as inactive nodes sit waiting for GC on http://webaudiodemos.appspot.com/MIDIDrums/index.html looks like:

    15.95%  libxul.so       [.] mozilla::StreamBuffer::FindTrack                
    11.28%  libxul.so       [.] mozilla::AudioNodeStream::AdvanceOutputSegment  
     9.21%  libxul.so       [.] mozilla::MediaSegmentBase<mozilla::AudioSegment,
     8.46%  libxul.so       [.] mozilla::MediaStreamGraphImpl::ProduceDataForStr
     6.54%  libxul.so       [.] mozilla::AudioNodeStream::ProcessInput          
     4.40%  libxul.so       [.] mozilla::AudioNodeStream::ObtainInputBlock      
     3.27%  liblgpllibs.so  [.] rdft_calc_c                                     
     2.37%  libxul.so       [.] mozilla::MediaStreamGraphImpl::UpdateStreamOrder
     1.82%  libxul.so       [.] mozilla::MediaStreamGraphImpl::NotifyHasCurrentD
     1.80%  liblgpllibs.so  [.] ff_fft_permute_sse.loop                         
     1.78%  libxul.so       [.] mozilla::StreamBuffer::ForgetUpTo               
     1.63%  libxul.so       [.] WebCore::DirectConvolver::process               
     1.60%  libxul.so       [.] mozilla::AudioBufferAddWithScale                
     1.55%  libxul.so       [.] WebCore::FFTConvolver::process                  
     1.36%  libxul.so       [.] moz_speex_interpolate_product_single            
     1.36%  libxul.so       [.] mozilla::BufferComplexMultiply                  
     1.26%  liblgpllibs.so  [.] pass_sse.loop                                   
     1.26%  libxul.so       [.] resampler_basic_interpolate_single              
     1.24%  libxul.so       [.] mozilla::FFTBlock::GetInverseWithoutScaling     
     1.14%  libxul.so       [.] mozilla::MediaStreamGraphImpl::UpdateCurrentTime
     0.95%  libxul.so       [.] cubic_coef                                      
     0.91%  libxul.so       [.] mozilla::MediaStream::EnsureTrack               
     0.91%  libxul.so       [.] mozilla::ProcessedMediaStream::AsProcessedStream
     0.85%  liblgpllibs.so  [.] fft16_sse                                       
     0.81%  libxul.so       [.] mozilla::MediaStreamGraphImpl::StreamSet::iterat

The patches that I'll attach here essentially removes 40% of this, including the top three entries, giving:

     9.77%  libxul.so       [.] mozilla::AudioNodeStream::ProcessInput          
     8.39%  libxul.so       [.] mozilla::AudioNodeStream::ObtainInputBlock      
     6.18%  liblgpllibs.so  [.] rdft_calc_c                                     
     5.27%  libxul.so       [.] mozilla::MediaStreamGraphImpl::UpdateStreamOrder
     5.20%  libxul.so       [.] mozilla::MediaStreamGraphImpl::ProduceDataForStr
     3.07%  liblgpllibs.so  [.] ff_fft_permute_sse.loop                         
     2.87%  libxul.so       [.] mozilla::AudioBufferAddWithScale                
     2.79%  libxul.so       [.] WebCore::FFTConvolver::process                  
     2.79%  libxul.so       [.] WebCore::DirectConvolver::process               
     2.66%  libxul.so       [.] mozilla::BufferComplexMultiply                  
     2.53%  libxul.so       [.] mozilla::MediaStreamGraphImpl::NotifyHasCurrentD
     2.51%  libxul.so       [.] moz_speex_interpolate_product_single            
     2.45%  libxul.so       [.] resampler_basic_interpolate_single              
     2.37%  liblgpllibs.so  [.] pass_sse.loop                                   
     2.36%  libxul.so       [.] mozilla::FFTBlock::GetInverseWithoutScaling     
     2.20%  libxul.so       [.] mozilla::MediaStreamGraphImpl::UpdateCurrentTime
     1.88%  libxul.so       [.] mozilla::MediaStreamGraphImpl::CreateOrDestroyAu
     1.72%  libxul.so       [.] mozilla::ProcessedMediaStream::AsProcessedStream
     1.65%  liblgpllibs.so  [.] fft16_sse                                       
     1.63%  libxul.so       [.] cubic_coef                                      
     1.62%  libxul.so       [.] mozilla::MediaStreamGraphImpl::StreamSet::iterat
     1.41%  libxul.so       [.] mozilla::FFTBlock::PerformFFT                   
     1.36%  libxul.so       [.] mozilla::DelayBuffer::ReadChannels              
     1.21%  libm-2.20.so    [.] __powf_finite                                   
     1.18%  liblgpllibs.so  [.] pass_interleave_sse.loop
Assignee

Comment 2

4 years ago
bug 1207003 remove unnecessary EnsureTrack() call r?padenot

EnsureTrack() will be called in AdvanceOutputSegment(), if not blocked.
Attachment #8664029 - Flags: review?(padenot)
Assignee

Comment 3

4 years ago
bug 1207003 coallesce external output chunks when silent r?padenot

AppendAndConsumeChunk() will always append a new chunk, but AppendNullData()
will use an existing null chunk if possible.
Attachment #8664030 - Flags: review?(padenot)
Assignee

Comment 4

4 years ago
bug 1207003 fetch stream position once instead of three times r?padenot
Attachment #8664031 - Flags: review?(padenot)
Assignee

Comment 5

4 years ago
bug 1207003 remove unused aStream parameter r?padenot
Attachment #8664032 - Flags: review?(padenot)
Assignee

Comment 6

4 years ago
bug 1207003 add GraphTime parameter to ProcessBlock() and remove GetCurrentPosition() r?padenot

This is immediately useful for making the track unnecessary, but will also be
required when switching to the destination node stream for tracking time (bug
1205558) because using GetCurrentPosition() on the destination node stream
would give different results depending on the stream processing order (when
called during processing of streams not strictly upstream from the destination
node).
Attachment #8664033 - Flags: review?(padenot)
Assignee

Comment 7

4 years ago
bug 1207003 only create track for external AudioNodeStreams r?padenot

IsFinishedOnGraphThread() was unnecessary due to the !mFinished test.
Attachment #8664034 - Flags: review?(padenot)
Comment on attachment 8664029 [details]
MozReview Request: bug 1207003 remove unnecessary EnsureTrack() call r?padenot

https://reviewboard.mozilla.org/r/19903/#review17943
Attachment #8664029 - Flags: review?(padenot) → review+
Comment on attachment 8664030 [details]
MozReview Request: bug 1207003 coallesce external output chunks when silent r?padenot

https://reviewboard.mozilla.org/r/19905/#review17945
Attachment #8664030 - Flags: review?(padenot) → review+
Comment on attachment 8664031 [details]
MozReview Request: bug 1207003 fetch stream position once instead of three times r?padenot

https://reviewboard.mozilla.org/r/19907/#review17947
Attachment #8664031 - Flags: review?(padenot) → review+
Comment on attachment 8664032 [details]
MozReview Request: bug 1207003 remove unused aStream parameter r?padenot

https://reviewboard.mozilla.org/r/19909/#review17951
Attachment #8664032 - Flags: review?(padenot) → review+
Comment on attachment 8664033 [details]
MozReview Request: bug 1207003 add GraphTime parameter to ProcessBlock() and remove GetCurrentPosition() r?padenot

https://reviewboard.mozilla.org/r/19911/#review17953
Attachment #8664033 - Flags: review?(padenot) → review+
Comment on attachment 8664034 [details]
MozReview Request: bug 1207003 only create track for external AudioNodeStreams r?padenot

https://reviewboard.mozilla.org/r/19913/#review17955
Attachment #8664034 - Flags: review?(padenot) → review+
Comment hidden (typo)
Assignee

Updated

4 years ago
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.