Disable DWriteFontCache loading on startup as a LightSpeed experiment
Our experiment on the effect of user profile's file cache has suggested that
there may be a performance gain on startup (measured by
Startup.FirstWebContents.NonEmptyPaint) by disabling DWriteFontCache loading
in PostProfileInit and forcing the browser to rebuild the cache every time after
a 30s delay. This is a LightSpeed experiment to test our speculation in Canary.
The experiment is documented here:
https://docs.google.com/document/d/1Mly9bOSqxGcSfhOcvpEzvItTcVAdm5jsOXdieTlrcu4/edit
BUG=508642
Review URL: https://codereview.chromium.org/1225203003
Cr-Commit-Position: refs/heads/master@{#338307}
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index e7f36d65..1c0d80d 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -53,6 +53,7 @@
#include "chrome/installer/util/installer_util_strings.h"
#include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/shell_util.h"
+#include "components/variations/variations_associated_data.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
@@ -348,7 +349,8 @@
// This function will create a read only section if cache file exists
// otherwise it will spawn utility process to build cache file, which will
// be used during next browser start/postprofileinit.
- if (!content::LoadFontCache(path)) {
+ if (!variations::GetVariationParamValue("LightSpeed",
+ "DisableDWriteFontCache").empty() || !content::LoadFontCache(path)) {
// We delay building of font cache until first startup page loads.
// During first renderer start there are lot of things happening
// simultaneously some of them are: