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

Issue 2381093002: Move GetNewTabCSS() caching off the startup path. (Closed)

Created:
4 years, 2 months ago by Alexei Svitkine (slow)
Modified:
4 years, 2 months ago
Reviewers:
Dan Beam, sky, Evan Stade
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move GetNewTabCSS() caching off the startup path. This function appears to take about a mean of 35ms during startup according to UMA sampling profiler data. Also, the current NTP doesn't need this CSS - since this is related to the old local NTP, which currently only powers chrome://apps. This also saves memory used by the generated CSS until the first time it's used. The downside is there will be a delay when loading this css - but given this codepath is only used by chrome://apps page, this seems like a reasonable trade-off. Note: The CSS will still be cached after the first request, since NTPResourceCache caches it and we fetch it from there. No intended functional changes. Expecting to see a 35ms startup improvement in UMA when this lands. BUG=651848 Committed: https://crrev.com/4417714b419462d698d03a790293818c6cecd81f Cr-Commit-Position: refs/heads/master@{#422578}

Patch Set 1 #

Patch Set 2 : Remove unneeded include. #

Total comments: 4

Patch Set 3 : Address comments. #

Patch Set 4 : Fix test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -29 lines) Patch
M chrome/browser/ui/webui/theme_source.h View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M chrome/browser/ui/webui/theme_source.cc View 1 2 7 chunks +22 lines, -24 lines 0 comments Download
M chrome/browser/ui/webui/theme_source_unittest.cc View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (19 generated)
Alexei Svitkine (slow)
4 years, 2 months ago (2016-09-30 15:38:27 UTC) #9
sky
I'm pretty sure this was done to make the new tab appear quicker. I suspect ...
4 years, 2 months ago (2016-09-30 16:01:39 UTC) #11
Alexei Svitkine (slow)
+dbeam sky: See CL description. This codepath is not used by the current NTP it's ...
4 years, 2 months ago (2016-09-30 16:27:21 UTC) #13
Alexei Svitkine (slow)
dbeam: Please review per chrome/browser/ui/webui owners.
4 years, 2 months ago (2016-09-30 16:28:11 UTC) #14
sky
Excellent! Thanks for clarifying (and I should have read the description more carefully). -Scott On ...
4 years, 2 months ago (2016-09-30 16:54:43 UTC) #15
Alexei Svitkine (slow)
dbeam: friendly ping Or let me know if you prefer that I find a different ...
4 years, 2 months ago (2016-10-03 15:49:14 UTC) #16
Dan Beam
doesn't this end up regenerated the incognito or guest new tab css every time a ...
4 years, 2 months ago (2016-10-03 16:23:12 UTC) #17
Dan Beam
regenerating*
4 years, 2 months ago (2016-10-03 16:23:20 UTC) #18
Dan Beam
+estade@ as he may be more familiar with this moving the creation off the startup ...
4 years, 2 months ago (2016-10-03 16:24:02 UTC) #20
Alexei Svitkine (slow)
I believe the CSS is still cached by NTPResourceCache.
4 years, 2 months ago (2016-10-03 16:25:40 UTC) #21
Alexei Svitkine (slow)
On 2016/10/03 16:25:40, Alexei Svitkine (slow) wrote: > I believe the CSS is still cached ...
4 years, 2 months ago (2016-10-03 19:06:20 UTC) #22
Evan Stade
awesome! lgtm https://codereview.chromium.org/2381093002/diff/80001/chrome/browser/ui/webui/theme_source.cc File chrome/browser/ui/webui/theme_source.cc (right): https://codereview.chromium.org/2381093002/diff/80001/chrome/browser/ui/webui/theme_source.cc#newcode65 chrome/browser/ui/webui/theme_source.cc:65: base::RefCountedMemory* GetNewTabCSSOnUIThread(Profile* profile) { nit: style guide ...
4 years, 2 months ago (2016-10-03 20:16:59 UTC) #24
Dan Beam
lgtm (agree with estade@'s comment assuming it's functionally equivalent)
4 years, 2 months ago (2016-10-03 20:39:46 UTC) #25
Alexei Svitkine (slow)
Thanks - comments addressed. https://codereview.chromium.org/2381093002/diff/80001/chrome/browser/ui/webui/theme_source.cc File chrome/browser/ui/webui/theme_source.cc (right): https://codereview.chromium.org/2381093002/diff/80001/chrome/browser/ui/webui/theme_source.cc#newcode65 chrome/browser/ui/webui/theme_source.cc:65: base::RefCountedMemory* GetNewTabCSSOnUIThread(Profile* profile) { On ...
4 years, 2 months ago (2016-10-03 21:02:45 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2381093002/100001
4 years, 2 months ago (2016-10-03 21:08:41 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/236748)
4 years, 2 months ago (2016-10-03 21:51:45 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2381093002/120001
4 years, 2 months ago (2016-10-03 22:05:32 UTC) #34
commit-bot: I haz the power
Committed patchset #4 (id:120001)
4 years, 2 months ago (2016-10-03 22:52:28 UTC) #36
commit-bot: I haz the power
4 years, 2 months ago (2016-10-03 22:54:29 UTC) #38
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/4417714b419462d698d03a790293818c6cecd81f
Cr-Commit-Position: refs/heads/master@{#422578}

Powered by Google App Engine
This is Rietveld 408576698