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

Issue 2767933002: [cc] Don't send missed BeginFrames with past deadline.

Created:
3 years, 9 months ago by Eric Seckler
Modified:
3 years, 8 months ago
Reviewers:
brianderson, piman
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, James Su, brianderson, enne (OOO), Sami, Fady Samuel
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[cc] Don't send missed BeginFrames with past deadline. This avoids unnecessary IPCs since the BeginFrames would be dropped by the cc::Scheduler in the renderer anyway, see linked bug. BUG=704895 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Patch Set 1 : . #

Patch Set 2 : don't issue missed BeginFrames with past deadline in BeginFrameSource::AddObserver #

Total comments: 8

Patch Set 3 : add ExternalBFS tests, don't check in DelayBasedBFS. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -12 lines) Patch
M cc/scheduler/begin_frame_source.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M cc/scheduler/begin_frame_source.cc View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M cc/scheduler/begin_frame_source_unittest.cc View 1 2 2 chunks +41 lines, -2 lines 0 comments Download
M cc/scheduler/delay_based_time_source.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 4 chunks +21 lines, -7 lines 0 comments Download

Messages

Total messages: 29 (25 generated)
Eric Seckler
Antoine, Brian, PTAL :) This seems to reduce the thread_IO_cpu_time_per_second and tasks_per_second_total_all for animated-gif.html, which ...
3 years, 9 months ago (2017-03-24 12:36:42 UTC) #22
Eric Seckler
+cc Fady FYI
3 years, 9 months ago (2017-03-24 13:48:07 UTC) #23
brianderson
https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_frame_source.cc File cc/scheduler/begin_frame_source.cc (right): https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_frame_source.cc#newcode202 cc/scheduler/begin_frame_source.cc:202: if (current_begin_frame_args_.deadline > time_source_->Now()) { Can you swap the ...
3 years, 9 months ago (2017-03-24 19:57:28 UTC) #24
Eric Seckler
3 years, 8 months ago (2017-03-27 09:53:25 UTC) #25
https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_fram...
File cc/scheduler/begin_frame_source.cc (right):

https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_fram...
cc/scheduler/begin_frame_source.cc:202: if (current_begin_frame_args_.deadline >
time_source_->Now()) {
On 2017/03/24 19:57:28, brianderson wrote:
> Can you swap the nested if's, which would avoid making a syscall to get the
> timestamp in some cases?

Actually, I think that DelayBasedBFS can't ever issue past deadlines anyway.
(The time source query above should avoid that.) So removed this if-statement
again.

I did swap the if-branches in ExternalBFS though. And I'm also special-casing
deadline == 0 there now, since that's what android's sync-compositor uses.

https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_fram...
cc/scheduler/begin_frame_source.cc:363: missed_begin_frame_args_.deadline >
Now()) {
On 2017/03/24 19:57:28, brianderson wrote:
> The changes in this file duplicate logic in
> Scheduler::BeginImplFrameWithDeadline. Can we remove the dupe in Scheduler?

I think it's fine to leave the logic in the cc::Scheduler, as the time may
change between when the browser issues a missed BF and when the renderer's
Scheduler receives it. (And since we need the call to Now() in Scheduler for
other reasons it doesn't add much overhead there.)

https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_fram...
File cc/scheduler/begin_frame_source.h (right):

https://codereview.chromium.org/2767933002/diff/60001/cc/scheduler/begin_fram...
cc/scheduler/begin_frame_source.h:315: virtual base::TimeTicks Now() const;
On 2017/03/24 19:57:28, brianderson wrote:
> Tests to come?

Yeah, added some :)

https://codereview.chromium.org/2767933002/diff/60001/content/browser/rendere...
File content/browser/renderer_host/render_widget_host_view_android.cc (right):

https://codereview.chromium.org/2767933002/diff/60001/content/browser/rendere...
content/browser/renderer_host/render_widget_host_view_android.cc:2015:
base::TimeTicks::Now() > adjusted_args.deadline) {
On 2017/03/24 19:57:28, brianderson wrote:
> This will call Now() once per RWHV. Not a big deal on Android, but if this is
a
> pattern we're going to repeat elsewhere, should we pass in now as an argument
to
> OnBeginFrame?
> 
> Looking at other BeginFrameObservers, they don't always use Now(), so probably
> not.

Yeay, the only reason we need it on android is the deadline adjustment above. No
other RWHVs do that. I think that's also the reason why we see "past-deadline"
missed BeginFrames in the renderer primarily on android.

Powered by Google App Engine
This is Rietveld 408576698