Tab-session-manager: Please support lazy loading of tabs like built-in session restore

Created on 24 Oct 2017  Â·  5Comments  Â·  Source: sienori/Tab-Session-Manager

I tend to have large sessions, since previously using session manager and auto unload tabs(not in use anymore with Fx 57), it has been possible to keep large amounts of tabs handy without huge memory costs.

When using Tab Session Manager, restoring a session is an extremely processor and memory heavy operation for a long time and many of the loads get stuck as Firefox chokes on likely thousands of concurrent requests. Lazy loading of restored tabs would avoid this, and speed up session restore a lot even for relatively small amounts of tabs.

Using 1.3.2 on Fx Quantum 57.0b10 (64-bit) on Windows.

enhancement solved

Most helpful comment

All 5 comments

I can not add that function because the API is not yet implemented.
I plan to respond in the future.

https://blog.mozilla.org/addons/2017/09/28/webextensions-in-firefox-57/

Tabs now have a discarded state added to the Tab object. It will be set to true if the tab is not loaded with content, for example when restored from a previous session. This is part of getting ready for a tabs.discard API.

For users who will refrain from using Firefox 57 or greater

Firefox ESR 52.5.0

– extended support release.

As far as I know, there was nothing like lazy tabs before 55.0.

Firefox 56.0.2

– without extended support from Mozilla, some people will treat this as an edge case.

Some users might prefer Session Manager, which supports browser.sessionstore.restore_on_demand (see for example Firefox/session restore - MozillaWiki but please note, that page is outdated).

Firefox Quantum

Mozilla bug 1322485 - Implement tabs.discard method for Desktop

RESOLVED FIXED in Firefox 58

Mozilla bug 1378647 - Support the "discarded" property inside browser.tabs.create() (2017-07-05)

Importance: P5 normal
Status: NEW

I wonder whether, within the constraints of Firefox 57.x, Tab Session Manager 1.5.0 can effectively work around an old Mozilla bug:

@hirvinen are you familiar with symptoms of that bug and if so, can you tell whether 1.5.0 is a workaround?

Seeing as implementing the discarded property in browser.tabs.create() is a P5 (thankfully approved), it will probably be a long time before we see that land. [Once (or if) this lands, this accomplishes the same idea as the "alternative" at the end of this post]

In the meantime, I am wondering if there is maybe a middle ground. I too have had some issues restoring large sessions and while I don't really mind the CPU usage (averages like 25%), the time to restore a large session is significant. Again, this isn't the end of the world, but I need to have the session restore successfully.

IF in a large session restore, there are 30-50 tabs loaded, when the session tries to restore 500+ tabs, there is a good possibility that memory will be pushed to the limit and I have even had it crash the browser. I would then retry the restore and while it is restoring, I would try to "Suspend all tabs" (which slows things down more), but the session could then restore successfully.

Suggestion
The idea I have is to have an option (optional obviously) to store the "discarded" version of the website within the session at all times. Therefore, when any session is restored, all of the tabs are idle and discarded which should allow large sessions to be restored successfully and as fast as possible.

Alternative
The other option would be to leave the session store the same as it is now, but change the "open session" process to provide an option (again optional to the user) to convert any active tabs to discarded versions of those tabs "on the fly" during the restore.

@sienori, what do you think?

@irvinm
I think about implementing that function in Alternative Plan.
When I experimented easily, memory usage decreased greatly by replacing pages.
This is a means to solve the big problem of TSM.

Was this page helpful?
0 / 5 - 0 ratings