Bug 1159248 - Simply pre-fill window.tabs[] with empty tab states instead of calling TabState.collect() to avoid perf regressions r=smacleod
authorTim Taubert <ttaubert@mozilla.com>
Mon, 04 May 2015 13:42:43 +0200
changeset 273756 ba9bb4a353b49c94071ce7bb7a9eedaf926cbf25
parent 273748 566f3ab3a23310453a13ef78ffe57e27dc32d7ea
child 273757 3b908ec52d4e3d8a15ac384e6d0571939e12d5fa
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmacleod
bugs1159248
milestone40.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 1159248 - Simply pre-fill window.tabs[] with empty tab states instead of calling TabState.collect() to avoid perf regressions r=smacleod
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -2749,17 +2749,18 @@ let SessionStoreInternal = {
     // It's important to set the window state to dirty so that
     // we collect their data for the first time when saving state.
     DirtyWindows.add(window);
 
     // In case we didn't collect/receive data for any tabs yet we'll have to
     // fill the array with at least empty tabData objects until |_tPos| or
     // we'll end up with |null| entries.
     for (let tab of Array.slice(tabbrowser.tabs, 0, tab._tPos)) {
-      this._windows[window.__SSi].tabs.push(TabState.collect(tab));
+      let emptyState = {entries: [], lastAccessed: tab.lastAccessed};
+      this._windows[window.__SSi].tabs.push(emptyState);
     }
 
     // Update the tab state in case we shut down without being notified.
     this._windows[window.__SSi].tabs[tab._tPos] = tabData;
 
     // Prepare the tab so that it can be properly restored. We'll pin/unpin
     // and show/hide tabs as necessary. We'll also attach a copy of the tab's
     // data in case we close it before it's been restored.