(Cc-ing Philipp Sackl, for UX feedback.)

At the moment, the simplified algorithm is the following:
1. Read sessionstore.js;
2. Open first window;
3. Synchronously, for each window in sessionstore.js, in the order in
which the windows have been opened initially, trigger window opening;
(Whenever a window is opened, restore its contents.)

Drawbacks:
* all windows are racing for CPU, DOM, http cache, etc. which makes
startup jank and pretty much ensures that Firefox becomes usable only
once all windows have finished loading;
* weird on-screen activity during startup, with all these windows
showing up in an apparently arbitrary order, whether in front or in the
back.

Ideally, I would like to change it as follows:
1. Read sessionstore.js;
2. Open first window;
3. Open the window most likely to be used immediately (i.e. the most
recently used window);
4. Asynchronously, once that window is restored, open in the background
the second window most likely to be used immediately;
5. etc.
(Whenever a window is opened, restore its contents.)

With this scheme, I believe that there are good chances that the user
will be presented with the right window immediately, that the window
will be usable faster and that the loading of other windows will take
place in the background, without distracting visual effects.

However, we cannot do this as changing the order in which windows are
opened also changes their order in the Windows taskbar and, possibly,
their order in MacOS X desktops.

Now, you are right, we can probably do as follows:
1. Read sessionstore.js;
2. Open first window;
3. For each window in sessionstore.js, in the order in which the windows
have been opened initially, trigger window opening (hidden);
4. Once we have opened the window that should appear first, make it
visible, restore its contents;
5. Asynchronously, once that window is restored and the second window
has been opened, make it visible and restore its contents;
6. etc.

A bit more complicated, but it should provide almost the same result.

Cheers,
 David


On 06/07/14 11:08, Neil wrote:
> David Rajchenbach-Teller wrote:
> 
>> We are considering redesigning slightly how windows are reopened by
>> Session Restore, to ensure that most recently used windows are loaded
>> first.
>>  
>>
> I can't quite tell from your phrasing whether the bottleneck here is the
> time it takes to open windows. I'm assuming it is, and that Session
> Restore has to wait for all the windows to open so that it can
> prioritise loading the most recent window first.
> 
> Since Session Restore already knows things such as the size and position
> of the window it wants to restore, I'm wondering whether it might it be
> possible to open the windows to about:blank and then start loading
> browser.xul in the most recent window first. (Obviously this only helps
> if there are three or more windows to restore, since you have to have
> loaded browser.xul in the first window to know you want to restore the
> previous session.)
> 


-- 
David Rajchenbach-Teller, PhD
 Performance Team, Mozilla

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to