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

Issue 1909063003: ImageQualityController should not post hundreds of canceled tasks. (Closed)

Created:
4 years, 8 months ago by esprehn
Modified:
4 years, 8 months ago
Reviewers:
chrishtr, pdr., dglazkov
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ImageQualityController should not post hundreds of canceled tasks. The MessageLoop can't actually cancel tasks, we just cancel the task in blink by nulling out the callback and then repost a new one. ImageQualityController was calling restartTimer() for every image in the entire page to schedule it's 500ms timer. For a for a page with many moving images like Animometer we would be processing hundreds of cancelled tasks between every frame as they got reposted. This patch avoids reposting the task if one is already scheduled. That seems fine since the timer only fires every 500ms anyway so waiting until the original fire time instead of moving the fire time forward by a few ms doesn't really matter. BUG=605701

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M third_party/WebKit/Source/core/layout/ImageQualityController.cpp View 1 chunk +6 lines, -1 line 1 comment Download

Messages

Total messages: 18 (8 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1909063003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1909063003/1
4 years, 8 months ago (2016-04-21 18:20:47 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-21 19:46:07 UTC) #4
esprehn
4 years, 8 months ago (2016-04-21 20:24:32 UTC) #8
dglazkov
lgtm
4 years, 8 months ago (2016-04-21 20:26:42 UTC) #10
chrishtr
https://codereview.chromium.org/1909063003/diff/1/third_party/WebKit/Source/core/layout/ImageQualityController.cpp File third_party/WebKit/Source/core/layout/ImageQualityController.cpp (right): https://codereview.chromium.org/1909063003/diff/1/third_party/WebKit/Source/core/layout/ImageQualityController.cpp#newcode145 third_party/WebKit/Source/core/layout/ImageQualityController.cpp:145: // Avoid reposting the timer if it's already active. ...
4 years, 8 months ago (2016-04-21 20:30:59 UTC) #12
chrishtr
Also: I can do this for you if you like, to increase paralleism.
4 years, 8 months ago (2016-04-21 21:00:04 UTC) #14
esprehn
On 2016/04/21 at 21:00:04, chrishtr wrote: > Also: I can do this for you if ...
4 years, 8 months ago (2016-04-21 22:35:00 UTC) #15
esprehn
And sure you can take this, note that calling ::Now() is very expensive, you don't ...
4 years, 8 months ago (2016-04-21 22:36:04 UTC) #16
chrishtr
On 2016/04/21 at 22:35:00, esprehn wrote: > On 2016/04/21 at 21:00:04, chrishtr wrote: > > ...
4 years, 8 months ago (2016-04-21 22:40:51 UTC) #17
chrishtr
4 years, 8 months ago (2016-04-21 22:41:12 UTC) #18
On 2016/04/21 at 22:36:04, esprehn wrote:
> And sure you can take this, note that calling ::Now() is very expensive, you
don't want to do that thousands of times. So we can't just keeping calling
::Now() to look at how much time has elapsed.

Ok I'll work on it.

Powered by Google App Engine
This is Rietveld 408576698