Bug 1640087: Part 1: optimize read ahead DLL prefetches for nightly users r=dthayer
authorEmma Malysz <emalysz@mozilla.com>
Fri, 22 May 2020 22:50:49 +0000
changeset 531757 281d0e9102251f66f7d7635b389ff65e4bf6ea54
parent 531756 c74722b0c0d5cde29b435e228a290eea157377a1
child 531758 f4da1835858c0db71e18276baea926f75c710fe4
push id37443
push usercbrindusan@mozilla.com
push dateSat, 23 May 2020 21:42:57 +0000
treeherdermozilla-central@9a2f741cef6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdthayer
bugs1640087
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1640087: Part 1: optimize read ahead DLL prefetches for nightly users r=dthayer Differential Revision: https://phabricator.services.mozilla.com/D76519
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3590,26 +3590,48 @@ static void ReadAheadPackagedDll(const w
   wchar_t dllPath[MAX_PATH];
   swprintf(dllPath, MAX_PATH, L"%s\\%s", aGREDir, dllName);
   ReadAheadLib(dllPath);
 }
 
 static void PR_CALLBACK ReadAheadDlls_ThreadStart(void* arg) {
   UniquePtr<wchar_t[]> greDir(static_cast<wchar_t*>(arg));
 
+  // In Bug 1628903, we investigated which DLLs we should prefetch in
+  // order to reduce disk I/O and improve startup on Windows machines.
+  // Our ultimate goal is to measure the impact of these improvements on
+  // retention (see Bug 1640087). Before we place this within a pref,
+  // we should ensure this feature only ships to the nightly channel
+  // and monitor results from that subset.
+#  ifdef NIGHTLY_BUILD
   // Prefetch the DLLs shipped with firefox
   ReadAheadPackagedDll(L"libegl.dll", greDir.get());
   ReadAheadPackagedDll(L"libGLESv2.dll", greDir.get());
   ReadAheadPackagedDll(L"nssckbi.dll", greDir.get());
   ReadAheadPackagedDll(L"freebl3.dll", greDir.get());
   ReadAheadPackagedDll(L"softokn3.dll", greDir.get());
 
   // Prefetch the system DLLs
   ReadAheadSystemDll(L"DWrite.dll");
   ReadAheadSystemDll(L"D3DCompiler_47.dll");
+#  else
+  // Load DataExchange.dll and twinapi.appcore.dll for
+  // nsWindow::EnableDragDrop
+  ReadAheadSystemDll(L"DataExchange.dll");
+  ReadAheadSystemDll(L"twinapi.appcore.dll");
+
+  // Load twinapi.dll for WindowsUIUtils::UpdateTabletModeState
+  ReadAheadSystemDll(L"twinapi.dll");
+
+  // Load explorerframe.dll for WinTaskbar::Initialize
+  ReadAheadSystemDll(L"ExplorerFrame.dll");
+
+  // Load WinTypes.dll for nsOSHelperAppService::GetApplicationDescription
+  ReadAheadSystemDll(L"WinTypes.dll");
+#  endif
 }
 #endif
 
 #if defined(MOZ_WAYLAND)
 bool IsWaylandDisabled() {
   // Enable Wayland on Gtk+ >= 3.22 where we can expect recent enough
   // compositor & libwayland interface.
   bool disableWayland = (gtk_check_version(3, 22, 0) != nullptr);