Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Issue 2071503003: Avoid flooding main thread by caching state on media thread. (Closed)

Created:
4 years, 6 months ago by alokp
Modified:
4 years, 6 months ago
CC:
chromium-reviews, CalebRouleau, ddorwin, feature-media-reviews_chromium.org, mark a. foltz, mlamouri (slow - plz ping)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid flooding main thread by caching state on media thread. OnStatisticsUpdate and OnBufferedTimeRangesChanged fire much more frequently than queried for. Posting all state change notifications to the main thread causes potential performance issues. Cache state not immediately required by PipelineClient on the media thread to avoid having to post all state change notifications. BUG=619975 Committed: https://crrev.com/8f268bb64214eab73f00216b96b919a1b2955999 Cr-Commit-Position: refs/heads/master@{#401457}

Patch Set 1 #

Total comments: 8

Patch Set 2 : rebase only #

Patch Set 3 : addressed comments #

Patch Set 4 : reverts reseting callbacks #

Total comments: 4

Patch Set 5 : added comment #

Patch Set 6 : adds dcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -173 lines) Patch
M media/base/pipeline_impl.h View 2 chunks +0 lines, -12 lines 0 comments Download
M media/base/pipeline_impl.cc View 1 2 3 4 5 29 chunks +188 lines, -161 lines 0 comments Download

Messages

Total messages: 25 (6 generated)
alokp
Perf tryjob is here: https://codereview.chromium.org/2073613002/
4 years, 6 months ago (2016-06-16 04:31:19 UTC) #2
DaleCurtis
I suspect this is now duplicating the logic in RendererMediaLog for similar reasons.
4 years, 6 months ago (2016-06-16 16:33:57 UTC) #4
alokp
On 2016/06/16 16:33:57, DaleCurtis wrote: > I suspect this is now duplicating the logic in ...
4 years, 6 months ago (2016-06-16 16:42:18 UTC) #5
DaleCurtis
I mean this https://cs.chromium.org/chromium/src/content/renderer/media/render_media_log.cc?l=58
4 years, 6 months ago (2016-06-16 17:06:24 UTC) #6
DaleCurtis
Probably the real fix is to stop sending so many of these at the source.
4 years, 6 months ago (2016-06-16 17:06:36 UTC) #7
alokp
On 2016/06/16 17:06:36, DaleCurtis wrote: > Probably the real fix is to stop sending so ...
4 years, 6 months ago (2016-06-16 18:01:07 UTC) #8
alokp
Attempt to reduce the number of OnStatisticsUpdate notifications at source is here: https://codereview.chromium.org/2079923002/ I am ...
4 years, 6 months ago (2016-06-17 22:47:13 UTC) #10
DaleCurtis
Did you perf try run come through and show this fixed everything? https://codereview.chromium.org/2071503003/diff/1/media/base/pipeline_impl.cc File media/base/pipeline_impl.cc ...
4 years, 6 months ago (2016-06-22 15:21:15 UTC) #11
alokp
Yes it does fix perf regressions: http://storage.googleapis.com/chromium-telemetry/html-results/results-2016-06-15_18-11-54 The new regressions are for seek times that ...
4 years, 6 months ago (2016-06-22 16:27:54 UTC) #12
DaleCurtis
https://codereview.chromium.org/2071503003/diff/1/media/base/pipeline_impl.cc File media/base/pipeline_impl.cc (right): https://codereview.chromium.org/2071503003/diff/1/media/base/pipeline_impl.cc#newcode242 media/base/pipeline_impl.cc:242: weak_factory_.InvalidateWeakPtrs(); On 2016/06/22 at 16:27:54, alokp wrote: > On ...
4 years, 6 months ago (2016-06-22 20:40:39 UTC) #13
alokp
https://codereview.chromium.org/2071503003/diff/1/media/base/pipeline_impl.cc File media/base/pipeline_impl.cc (right): https://codereview.chromium.org/2071503003/diff/1/media/base/pipeline_impl.cc#newcode242 media/base/pipeline_impl.cc:242: weak_factory_.InvalidateWeakPtrs(); On 2016/06/22 20:40:39, DaleCurtis wrote: > On 2016/06/22 ...
4 years, 6 months ago (2016-06-22 20:52:03 UTC) #14
DaleCurtis
lgtm % one additional revert. https://codereview.chromium.org/2071503003/diff/60001/media/base/pipeline_impl.cc File media/base/pipeline_impl.cc (right): https://codereview.chromium.org/2071503003/diff/60001/media/base/pipeline_impl.cc#newcode272 media/base/pipeline_impl.cc:272: // Invalidate self weak ...
4 years, 6 months ago (2016-06-22 21:00:07 UTC) #15
alokp
https://codereview.chromium.org/2071503003/diff/60001/media/base/pipeline_impl.cc File media/base/pipeline_impl.cc (right): https://codereview.chromium.org/2071503003/diff/60001/media/base/pipeline_impl.cc#newcode272 media/base/pipeline_impl.cc:272: // Invalidate self weak pointers effectively canceling all pending ...
4 years, 6 months ago (2016-06-22 21:13:34 UTC) #16
DaleCurtis
Okay, then lets just add a DCHECK(!weak_factory_.HasWeakPtrs()); in the destructor.
4 years, 6 months ago (2016-06-22 21:22:19 UTC) #17
alokp
On 2016/06/22 21:22:19, DaleCurtis wrote: > Okay, then lets just add a DCHECK(!weak_factory_.HasWeakPtrs()); in the ...
4 years, 6 months ago (2016-06-22 21:42:11 UTC) #18
DaleCurtis
lgtm
4 years, 6 months ago (2016-06-22 21:45:54 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2071503003/100001
4 years, 6 months ago (2016-06-22 21:49:14 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 6 months ago (2016-06-22 23:27:06 UTC) #23
commit-bot: I haz the power
4 years, 6 months ago (2016-06-22 23:30:24 UTC) #25
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/8f268bb64214eab73f00216b96b919a1b2955999
Cr-Commit-Position: refs/heads/master@{#401457}

Powered by Google App Engine
This is Rietveld 408576698