New issue
Advanced search Search tips

Issue 605701 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 606211



Sign in to add a comment

Animometer leaves benchmark processes hundreds of tasks from ImageQualityController

Project Member Reported by esprehn@chromium.org, Apr 21 2016

Issue description

Google Chrome	52.0.2713.0 (Official Build) canary (64-bit)
Revision	939788c10e98a18cb74d5311f8792105930d9bd9-refs/heads/master@{#388380}
OS	Mac OS X 

src_file	
"../../third_party/WebKit/Source/core/layout/ImageQualityController.cpp"
src_func	
"restartTimer"

 
leaves-tasks.png
73.9 KB View Download
leaves-one-task.png
34.3 KB View Download
trace_leaves-imagequalitycontroller-tasks.json.gz
3.9 MB Download
The trace is created with:

1) Load https://pr.gg/animometer/developer.html
2) Choose Animometer > Leaves
3) Choose Maintain Target FPS
4) Set target FPS to 50
5) Click "Run Benchmark".

Attached is a trace with the CL from https://codereview.chromium.org/1909063003 applied. Notice the nice gaps between the BeginMainFrame tasks and that nothing is scheduled on the main thread on top of the raster tasks.
trace_leaves-with-fix-from-cl-1909063003.json.gz
3.1 MB Download
This is a great find!
Cc: esprehn@chromium.org
Owner: chrishtr@chromium.org
chrishtr@ Said he'd fix this. :)

Comment 5 by ojan@chromium.org, Apr 22 2016

Labels: Hotlist-Animometer
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40

commit f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40
Author: chrishtr <chrishtr@chromium.org>
Date: Sun Apr 24 00:02:33 2016

Don't restart the ImageQualityController timer unless it is already half over.

Restarting the timer every time an image continues to animate is very expensive,
because there is no way to actuually cancel the existing timer. Instead, the timer
is neutered, so that when it fires it will do nothing. This results in a flood
of no-op timer callbacks in the referenced bug scenario.

Instead, only restart the timer if the current frame time is more than half
of the timer time later than the frame time at the start of the timer.
To accomplish that, record the current frame time in WebViewImpl, so that it
can be compared with a future frame time.

We do this plumbing to avoid making lots of calls to query the system time,
which is expensive. The compositor has a similar optimization; see
https://code.google.com/p/chromium/codesearch#chromium/src/cc/layers/picture_layer_impl.cc&sq=package:chromium&l=452
for example.

BUG= 605701 

Review URL: https://codereview.chromium.org/1911273002

Cr-Commit-Position: refs/heads/master@{#389394}

[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/layout/ImageQualityController.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/layout/ImageQualityController.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/page/ChromeClient.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/ChromeClientImpl.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/ChromeClientImpl.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/public/web/WebWidget.h

Comment 7 by vmi...@chromium.org, Apr 24 2016

Blocking: 606211
Status: Fixed (was: Assigned)
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 25 2016

Labels: merge-merged-2716
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40

commit f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40
Author: chrishtr <chrishtr@chromium.org>
Date: Sun Apr 24 00:02:33 2016

Don't restart the ImageQualityController timer unless it is already half over.

Restarting the timer every time an image continues to animate is very expensive,
because there is no way to actuually cancel the existing timer. Instead, the timer
is neutered, so that when it fires it will do nothing. This results in a flood
of no-op timer callbacks in the referenced bug scenario.

Instead, only restart the timer if the current frame time is more than half
of the timer time later than the frame time at the start of the timer.
To accomplish that, record the current frame time in WebViewImpl, so that it
can be compared with a future frame time.

We do this plumbing to avoid making lots of calls to query the system time,
which is expensive. The compositor has a similar optimization; see
https://code.google.com/p/chromium/codesearch#chromium/src/cc/layers/picture_layer_impl.cc&sq=package:chromium&l=452
for example.

BUG= 605701 

Review URL: https://codereview.chromium.org/1911273002

Cr-Commit-Position: refs/heads/master@{#389394}

[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/layout/ImageQualityController.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/layout/ImageQualityController.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/core/page/ChromeClient.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/ChromeClientImpl.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/ChromeClientImpl.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40/third_party/WebKit/public/web/WebWidget.h

Sign in to add a comment