From 96e1bd02f4cdfdc94cf767d9d2bd718d8b96b05a Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Fri, 15 Dec 2017 22:25:52 -0800 Subject: [PATCH] #444, #334: retune session store; remove telemetry --- browser/app/profile/firefox.js | 10 +++---- .../components/sessionstore/SessionStore.jsm | 30 +++++++++++-------- xpcom/base/CycleCollectedJSRuntime.cpp | 2 ++ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 58d8eb5b8..733471663 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1013,7 +1013,7 @@ pref("browser.sessionstore.resume_from_crash", true); pref("browser.sessionstore.resume_session_once", false); // minimal interval between two save operations in milliseconds -pref("browser.sessionstore.interval", 25000); +pref("browser.sessionstore.interval", 30000); // on which sites to save text data, POSTDATA and cookies // 0 = everywhere, 1 = unencrypted sites, 2 = nowhere pref("browser.sessionstore.privacy_level", 0); @@ -1026,9 +1026,9 @@ pref("browser.sessionstore.max_windows_undo", 2); // (this pref has no effect if more than 6 hours have passed since the last crash) pref("browser.sessionstore.max_resumed_crashes", 1); // number of back button session history entries to restore (-1 = all of them) -pref("browser.sessionstore.max_serialize_back", 10); +pref("browser.sessionstore.max_serialize_back", 5); // number of forward button session history entries to restore (-1 = all of them) -pref("browser.sessionstore.max_serialize_forward", -1); +pref("browser.sessionstore.max_serialize_forward", 5); // restore_on_demand overrides MAX_CONCURRENT_TAB_RESTORES (sessionstore constant) // and restore_hidden_tabs. When true, tabs will not be restored until they are // focused (also applies to tabs that aren't visible). When false, the values @@ -1051,8 +1051,8 @@ pref("browser.sessionstore.debug", false); // browser tabs that were not caused by a flush from the parent. // This is a testing flag and should not be used by end-users. pref("browser.sessionstore.debug.no_auto_updates", false); -// Forget closed windows/tabs after two weeks -pref("browser.sessionstore.cleanup.forget_closed_after", 1209600000); +// Forget closed windows/tabs after 24 hours +pref("browser.sessionstore.cleanup.forget_closed_after", 86400000); // allow META refresh by default pref("accessibility.blockautorefresh", false); diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index bdb64a98c..48c054b3c 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -506,7 +506,7 @@ var SessionStoreInternal = { throw new Error("SessionStore.init() must only be called once!"); } - TelemetryTimestamps.add("sessionRestoreInitialized"); + //TelemetryTimestamps.add("sessionRestoreInitialized"); OBSERVING.forEach(function(aTopic) { Services.obs.addObserver(this, aTopic, true); }, this); @@ -519,7 +519,7 @@ var SessionStoreInternal = { * Initialize the session using the state provided by SessionStartup */ initSession: function () { - TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); + //TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); let state; let ss = gSessionStartup; @@ -593,7 +593,7 @@ var SessionStoreInternal = { this._prefBranch.getBoolPref("sessionstore.resume_session_once")) this._prefBranch.setBoolPref("sessionstore.resume_session_once", false); - TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); + //TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); return state; }, @@ -743,7 +743,7 @@ var SessionStoreInternal = { // Record telemetry measurements done in the child and update the tab's // cached state. Mark the window as dirty and trigger a delayed write. - this.recordTelemetry(aMessage.data.telemetry); + //this.recordTelemetry(aMessage.data.telemetry); TabState.update(browser, aMessage.data); this.saveStateDelayed(win); @@ -874,9 +874,11 @@ var SessionStoreInternal = { * value to be recorded for that ID, */ recordTelemetry: function (telemetry) { + /* for (let histogramId in telemetry){ Telemetry.getHistogramById(histogramId).add(telemetry[histogramId]); } + */ }, /* ........ Window Event Handlers .............. */ @@ -1025,7 +1027,7 @@ var SessionStoreInternal = { // Nothing to restore now, notify observers things are complete. Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, ""); } else { - TelemetryTimestamps.add("sessionRestoreRestoring"); + //TelemetryTimestamps.add("sessionRestoreRestoring"); this._restoreCount = aInitialState.windows ? aInitialState.windows.length : 0; // global data must be restored before restoreWindow is called so that @@ -1188,9 +1190,9 @@ var SessionStoreInternal = { if (initialState) { Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP, ""); } - TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); + //TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); this.initializeWindow(aWindow, initialState); - TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); + //TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); // Let everyone know we're done. this._deferredInitialized.resolve(); @@ -2675,7 +2677,7 @@ var SessionStoreInternal = { var activeWindow = this._getMostRecentBrowserWindow(); - TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); + //TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); if (RunState.isRunning) { // update the data for all windows with activities since the last save operation this._forEachBrowserWindow(function(aWindow) { @@ -2690,7 +2692,7 @@ var SessionStoreInternal = { }); DirtyWindows.clear(); } - TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); + //TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); // An array that at the end will hold all current window data. var total = []; @@ -2710,9 +2712,9 @@ var SessionStoreInternal = { nonPopupCount++; } - TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); + //TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); SessionCookies.update(total); - TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); + //TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); // collect the data for all windows yet to be restored for (ix in this._statesToRestore) { @@ -2877,7 +2879,7 @@ var SessionStoreInternal = { if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi])) this.onLoad(aWindow); - TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); + //TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); // We're not returning from this before we end up calling restoreTabs // for this window, so make sure we send the SSWindowStateBusy event. @@ -3031,7 +3033,7 @@ var SessionStoreInternal = { // set smoothScroll back to the original value tabstrip.smoothScroll = smoothScroll; - TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); + //TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); this._setWindowStateReady(aWindow); @@ -4146,6 +4148,7 @@ var SessionStoreInternal = { * Handle an error report from a content process. */ reportInternalError(data) { + /* // For the moment, we only report errors through Telemetry. if (data.telemetry) { for (let key of Object.keys(data.telemetry)) { @@ -4153,6 +4156,7 @@ var SessionStoreInternal = { histogram.add(data.telemetry[key]); } } + */ } }; diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index 54c542fd2..a7e153a3f 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -1229,7 +1229,9 @@ IncrementalFinalizeRunnable::Run() return NS_OK; } +#if(0) TimeStamp start = TimeStamp::Now(); +#endif ReleaseNow(true); if (mDeferredFinalizeFunctions.Length()) {