Closed
Bug 1163958
Opened 10 years ago
Closed 10 years ago
Reduce the allocation in MediaStreamGraph
Categories
(Core :: Web Audio, defect)
Core
Web Audio
Tracking
()
RESOLVED
FIXED
mozilla41
| Tracking | Status | |
|---|---|---|
| firefox41 | --- | fixed |
People
(Reporter: baku, Assigned: baku)
References
Details
(Keywords: perf)
Attachments
(2 files, 3 obsolete files)
|
11.40 KB,
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
|
24.12 KB,
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
Often we create temporary arrays to store part of the graph.
We should try to avoid this because that can cause allocation.
Attachment #8604587 -
Flags: review?(padenot)
| Assignee | ||
Comment 1•10 years ago
|
||
This first patch contains also some indentation things. If you prefer I can split it in another patch.
| Assignee | ||
Comment 2•10 years ago
|
||
This patch manly introduces StreamBuffer::GetAndResetTracksDirty() and that is used to do or not to do all the MediaStreamGraphImpl::CreateOrDestroyAudio logic.
Attachment #8604607 -
Flags: review?(padenot)
| Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8604607 -
Attachment is obsolete: true
Attachment #8604607 -
Flags: review?(padenot)
Attachment #8604622 -
Flags: review?(padenot)
| Assignee | ||
Comment 4•10 years ago
|
||
This patch reverts some changes done in previous patches.
The new logic was not fully correct. (but the tests pass...)
Attachment #8604622 -
Attachment is obsolete: true
Attachment #8604622 -
Flags: review?(padenot)
Attachment #8604707 -
Flags: review?(padenot)
| Assignee | ||
Comment 5•10 years ago
|
||
Ah.. my fault. The previous comment was about this patch. f.patch is ok.
Attachment #8604587 -
Attachment is obsolete: true
Attachment #8604587 -
Flags: review?(padenot)
Attachment #8604709 -
Flags: review?(padenot)
Comment 6•10 years ago
|
||
Comment on attachment 8604707 [details] [diff] [review]
f.patch
Review of attachment 8604707 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/StreamBuffer.cpp
@@ +82,5 @@
> +
> + if (mTracks[middle]->GetID() > aID) {
> + right = middle - 1;
> + } else {
> + left = middle + 1;
Maybe we can simply use https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTArray.h?from=nsTArray.h#1146 since mTracks is an nsTArray ?
Attachment #8604707 -
Flags: review?(padenot) → review+
Updated•10 years ago
|
Attachment #8604709 -
Flags: review?(padenot) → review+
| Assignee | ||
Comment 7•10 years ago
|
||
> Maybe we can simply use
> https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTArray.
> h?from=nsTArray.h#1146 since mTracks is an nsTArray ?
That returns the offset of a known item. I didn't find a binary search implementation for nsTArray that matches this case.
| Assignee | ||
Comment 8•10 years ago
|
||
| Assignee | ||
Comment 9•10 years ago
|
||
Comment 10•10 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #7)
> > Maybe we can simply use
> > https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTArray.
> > h?from=nsTArray.h#1146 since mTracks is an nsTArray ?
>
> That returns the offset of a known item. I didn't find a binary search
> implementation for nsTArray that matches this case.
I'm pretty sure you can use the nsTArray version, but even if you couldn't, you could at least use the underlying implementation it's based on:
http://mxr.mozilla.org/mozilla-central/source/mfbt/BinarySearch.h#45
https://hg.mozilla.org/mozilla-central/rev/7353d8b80065
https://hg.mozilla.org/mozilla-central/rev/f0fdc3d257f5
https://hg.mozilla.org/mozilla-central/rev/fb80461d81fb
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•