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

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 992413003: Delay font cache building by few seconds to yield for startup resource contention. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added more description as per comment from reviewer. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index 3458df209274da8ea28e0234ff4bc4cd4454767b..1a93a3bf91216bd814cad6b139e6bece09978c73 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -249,9 +249,26 @@ void ChromeBrowserMainPartsWin::PostProfileInit() {
// otherwise it will spawn utility process to build cache file, which will
// be used during next browser start/postprofileinit.
if (!content::LoadFontCache(path)) {
- content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(ExecuteFontCacheBuildTask, path));
+ // We delay building of font cache until first startup page loads.
+ // Selected 5 seconds as delay based on 50th percentile value
+ // for Startup.FirstWebContents.NonEmptyPaint.
+ // During first renderer start there are lot of things happening
+ // simultaneously some of them are:
+ // - Renderer is going through all font files on the system to create
+ // a font collection.
+ // - Renderer loading up startup URL, accessing HTML/JS File cache,
+ // net activity etc.
+ // - Extension initialization.
+ // We delay building of cache mainly to avoid parallel font file
+ // loading along with Renderer. Some systems have significant number of
+ // font files which takes long time to process.
+ // Related information is at http://crbug.com/436195.
+ const int kBuildFontCacheDelaySec = 5;
gab 2015/03/12 12:44:43 I don't think 5s is enough. From timelinev2: http
Shrikant Kelkar 2015/03/17 23:32:23 Modified delay to 30s
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::IO,
gab 2015/03/12 12:44:43 Does this have to be on the IO thread? The IO thre
Shrikant Kelkar 2015/03/17 23:32:23 Most utility processes start on IO thread as after
+ FROM_HERE,
+ base::Bind(ExecuteFontCacheBuildTask, path),
+ base::TimeDelta::FromSeconds(kBuildFontCacheDelaySec));
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698