At the moment, collection Session restore data is done in a blocking manner: getBrowserState, getWindowState, getTabState freeze the main thread while they collect their data, causing jank. We could avoid that jank by reorganizing data collection as follows: - the Session restore service maintains a cache of the state, which may not be full up to date; - getBrowserState, getWindowState, getTabState return (subsets of) the latest cached state; - a new method |snapshot| triggers an asynchronous update to the cache (or a subset thereof), returning a promise and/or accepting a custom observer; - saveStateDelayed is altered to proceed only once the snapshot is complete.
gps: I believe that you are the sole user of getBrowserState on m-c, will this break anything in Sync?
6 years ago
Depends on: 829949
Deferring to rnewman since he has more of Sync paged into his brain than I do right now.
Flags: needinfo?(gps) → needinfo?(rnewman)
The only two things we do with the session instance is: * getBrowserState to find out open tabs * setTabValue in an observer notification to set a weaveLastUsed timestamp. The latter doesn't apply here, I suppose. I would be very happy to consume an alternative API which provides the set of windows and open tabs. Having a *slightly* stale set through the current API would be fine.
Whiteboard: [Snappy] → [Snappy][sync:tabs]
5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 838577
You need to log in before you can comment on or make changes to this bug.