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

Issue 1538773002: Reduce CPU usage of download shelf UI. (both MD and pre-MD shelves) (Closed)

Created:
5 years ago by Evan Stade
Modified:
4 years, 11 months ago
Reviewers:
asanka, msw, sky
CC:
chromium-reviews, tfarina, jam, darin-cc_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reduce CPU usage of download shelf UI. (both MD and pre-MD shelves) Mainly by getting rid of excessive painting. Changes: 1. We don't need to repaint progress every 30ms in the common case (known file size) because we will only paint something different if the percent downloaded has actually changed. When that changes, the item receives OnDownloadUpdated(), so there's no purpose of a repeating timer on top of that. 2. We don't need to repaint the entire shelf every time one item on it updates. I don't know why that was ever necessary, but I can no longer see a reason for it. Effects: 1. On a release build on my local machine, the GPU process drops from ~10% per active download to ~1% per active download (almost indistinguishable from steady state given my unscientific testing methodology). 2. The browser process still uses a high amount of CPU, but most of that is in handling the actual download, not displaying the UI. Closing the shelf has nearly no effect on browser process and gpu process utilization. 3. Indeterminate progress DLs still use a lot of CPU. TODO(estade): fix this. Side notes: 1. Even without this change, the material shelf is a bit faster than the non-material shelf, but not by an order of magnitude. BUG=569354 Committed: https://crrev.com/5f6f7b5b7d6ac71ed2578231944addaa0b9d21c7 Cr-Commit-Position: refs/heads/master@{#368463}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 6

Patch Set 3 : rebase #

Patch Set 4 : revert content change #

Patch Set 5 : no change for indeterminate size dls #

Total comments: 4

Patch Set 6 : warning repaint #

Patch Set 7 : align #

Patch Set 8 : warning dialog tested (fix MD only bug) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -71 lines) Patch
M chrome/browser/ui/views/download/download_item_view.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 10 chunks +30 lines, -36 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view_md.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view_md.cc View 1 2 3 4 5 6 7 14 chunks +36 lines, -35 lines 0 comments Download

Messages

Total messages: 46 (16 generated)
Evan Stade
+msw, could you take a look since Scott is OOO? +rdsmith for chrome/browser/download/ and content/browser/download/ ...
5 years ago (2015-12-18 00:57:17 UTC) #2
Evan Stade
On 2015/12/18 00:57:17, Evan Stade wrote: > +msw, could you take a look since Scott ...
5 years ago (2015-12-18 02:06:30 UTC) #3
asanka
https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (left): https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc#oldcode244 chrome/browser/ui/views/download/download_item_view.cc:244: base::TimeDelta::FromMilliseconds(DownloadShelf::kProgressRateMs), Would you be willing to get rid of ...
5 years ago (2015-12-18 03:39:16 UTC) #5
Evan Stade
https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (left): https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc#oldcode244 chrome/browser/ui/views/download/download_item_view.cc:244: base::TimeDelta::FromMilliseconds(DownloadShelf::kProgressRateMs), On 2015/12/18 03:39:16, asanka wrote: > Would you ...
5 years ago (2015-12-18 19:01:38 UTC) #6
Randy Smith (Not in Mondays)
Asanka's the right person for reviewing Downloads UI changes--removing myself from the reviewers list. (But ...
4 years, 12 months ago (2015-12-28 00:55:42 UTC) #7
Evan Stade
ping https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (left): https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc#oldcode244 chrome/browser/ui/views/download/download_item_view.cc:244: base::TimeDelta::FromMilliseconds(DownloadShelf::kProgressRateMs), On 2015/12/18 19:01:38, Evan Stade wrote: > ...
4 years, 11 months ago (2015-12-29 18:50:49 UTC) #10
Randy Smith (Not in Mondays)
On 2015/12/29 18:50:49, Evan Stade wrote: > ping > > https://codereview.chromium.org/1538773002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc > File chrome/browser/ui/views/download/download_item_view.cc (left): ...
4 years, 11 months ago (2015-12-29 18:55:24 UTC) #12
Evan Stade
https://codereview.chromium.org/1538773002/diff/20001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/1538773002/diff/20001/content/browser/download/download_item_impl.cc#newcode1060 content/browser/download/download_item_impl.cc:1060: if (previous_progress != -1 && PercentComplete() != previous_progress) On ...
4 years, 11 months ago (2015-12-29 18:57:03 UTC) #13
Evan Stade
On 2015/12/29 18:55:24, Randy Smith - Not in Fridays wrote: > On 2015/12/29 18:50:49, Evan ...
4 years, 11 months ago (2015-12-29 19:01:57 UTC) #14
Evan Stade
On 2015/12/29 19:01:57, Evan Stade wrote: > On 2015/12/29 18:55:24, Randy Smith - Not in ...
4 years, 11 months ago (2016-01-04 23:58:06 UTC) #15
asanka
What happens for downloads with indeterminate progress?
4 years, 11 months ago (2016-01-05 03:23:20 UTC) #16
Evan Stade
On 2016/01/05 03:23:20, asanka wrote: > What happens for downloads with indeterminate progress? As noted ...
4 years, 11 months ago (2016-01-05 19:55:25 UTC) #17
asanka
On 2016/01/05 19:55:25, Evan Stade wrote: > On 2016/01/05 03:23:20, asanka wrote: > > What ...
4 years, 11 months ago (2016-01-06 16:13:35 UTC) #18
Evan Stade
If this change lgty, I'll update the CL description. https://codereview.chromium.org/1538773002/diff/80001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/1538773002/diff/80001/chrome/browser/ui/views/download/download_item_view.cc#newcode1402 chrome/browser/ui/views/download/download_item_view.cc:1402: ...
4 years, 11 months ago (2016-01-06 19:34:10 UTC) #19
asanka
LGTM https://codereview.chromium.org/1538773002/diff/80001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/1538773002/diff/80001/chrome/browser/ui/views/download/download_item_view.cc#newcode1402 chrome/browser/ui/views/download/download_item_view.cc:1402: SchedulePaint(); On 2016/01/06 19:34:10, Evan Stade wrote: > ...
4 years, 11 months ago (2016-01-06 19:44:29 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1538773002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1538773002/80001
4 years, 11 months ago (2016-01-06 20:02:34 UTC) #23
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-06 20:43:32 UTC) #25
sky
https://codereview.chromium.org/1538773002/diff/80001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/1538773002/diff/80001/chrome/browser/ui/views/download/download_item_view.cc#newcode280 chrome/browser/ui/views/download/download_item_view.cc:280: // Force the shelf to layout again as our ...
4 years, 11 months ago (2016-01-06 21:47:21 UTC) #26
Evan Stade
asanka, I'm having trouble finding a dangerous download and I'm not sure my debug code ...
4 years, 11 months ago (2016-01-07 00:06:05 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1538773002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1538773002/120001
4 years, 11 months ago (2016-01-07 00:06:22 UTC) #29
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-07 00:42:59 UTC) #31
sky
LGTM
4 years, 11 months ago (2016-01-07 00:43:35 UTC) #32
asanka
On 2016/01/07 00:06:05, Evan Stade wrote: > asanka, I'm having trouble finding a dangerous download ...
4 years, 11 months ago (2016-01-07 17:31:06 UTC) #33
Evan Stade
On 2016/01/07 17:31:06, asanka wrote: > On 2016/01/07 00:06:05, Evan Stade wrote: > > asanka, ...
4 years, 11 months ago (2016-01-07 18:46:06 UTC) #34
Evan Stade
> I didn't look at the latest changes to the danger > prompt code yet. ...
4 years, 11 months ago (2016-01-08 21:23:52 UTC) #35
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1538773002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1538773002/140001
4 years, 11 months ago (2016-01-08 21:24:17 UTC) #37
asanka
lgtm
4 years, 11 months ago (2016-01-08 21:55:35 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1538773002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1538773002/140001
4 years, 11 months ago (2016-01-08 22:11:50 UTC) #42
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 11 months ago (2016-01-08 23:51:13 UTC) #44
commit-bot: I haz the power
4 years, 11 months ago (2016-01-08 23:52:32 UTC) #46
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/5f6f7b5b7d6ac71ed2578231944addaa0b9d21c7
Cr-Commit-Position: refs/heads/master@{#368463}

Powered by Google App Engine
This is Rietveld 408576698