Firefox/Projects/Per Tab Network Prioritization: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with '= Overview = '''Sprint lead:''' zpao '''Sprinters:''' zpao, limi ;Description :We want to do some network prioritization such that the tab / window that you are currently using…')
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Overview =
= Overview =
'''Sprint lead:''' zpao


'''Sprinters:''' zpao, limi
'''Sprint lead:''' zpao
 
'''Sprinters:''' zpao, limi  
 
'''QA Contact:''' whimboo
 
'''Description'''


;Description
:We want to do some network prioritization such that the tab / window that you are currently using have higher network priority than the ones you aren't using.
:We want to do some network prioritization such that the tab / window that you are currently using have higher network priority than the ones you aren't using.
''The goal is to optimize tab loading and performance on startup.''
We propose to do this in two stages:<br>
*'''Firefox 3.6''': A simple enhancement where we assign priorities to the network loading of the different tabs. This should give us a quick win and make the initial page load of the focused tab complete earlier.
*'''Firefox 3.7''': A more comprehensive enhancement to make it possible to load tabs in most-recently-used order, as well as possibly set a threshold for how many tabs get loaded at once. This should take care of the more extreme cases where people are opening 30+ tabs on restore.<br>


= Goals / Use Cases =
= Goals / Use Cases =
Line 12: Line 23:
* Make current tab more responsive than background tabs.
* Make current tab more responsive than background tabs.


= Non Goals =
= Non-Goals in this iteration  =
* MRU network prioritization
 
The first iteration will be a simpler version, for the next iteration (3.7?) we should consider:
 
*MRU network prioritization.
*A threshold on how many tabs are loaded in parallel to control cpu/network load.
*Batch up these groups based on MRU order.<br><br>
 
= Design  =
 
There are a couple ways we could do this:


= Design =
*Put it all in tabbrowser.xml &amp; browser.js &amp; just jigger priorities directly.  
There are a couple ways we could do this:
*Put it in a new component (or whatever) that listens for TabSelect (and window select)<br>
* Put it all in tabbrowser.xml & browser.js & just jigger priorities directly.
* Put it in a new component (or whatever) that listens for TabSelect (and window select)


Either way, we'll have to  
If possible, we also want to be able to have an interrupt give higher priority to a tab if you switch to it during the initial page load. E.g. if you switch to the unfocused window, the priorities mirror what was in the initial focused window had, and the now-unfocused window has its priorities downgraded.<br><br>


= Prioritization =
= Prioritization =
Line 26: Line 44:
[https://developer.mozilla.org/en/nsISupportsPriority Priorities] range from 20 to -20 with -20 being the highest. There are 5 presets (highest, high, normal, low, lowest).
[https://developer.mozilla.org/en/nsISupportsPriority Priorities] range from 20 to -20 with -20 being the highest. There are 5 presets (highest, high, normal, low, lowest).


== What To Do With Priorities ==
== What To Do With Priorities ==
The general proposition here is as follows
 
The general proposition here is as follows:
 
{|
{|
! !! Focused Tab !! Unfocused Tab
|-
|-
! Front-most Window
! <br>
| high || normal
! Focused Tab
! Unfocused Tab
|-
! Front-most Window  
| high  
| normal
|-
|-
! Background Window
! Background Window  
| normal || low
| normal  
| low
|-
|-
! Minimized Window
! Minimized Window  
| low || lowest
| low  
|  
lowest  
 
|}
|}
A visual way of looking at it — [] indicates frontmost tab:
'''Focused window:'''
<pre> ________  ________  ________
| Medium || [High] || Medium |
</pre>
'''Unfocused (but visible) window:'''
<pre> _____  __________  _____
| Low || [Medium] || Low |
</pre>
'''Minimized window:'''
<pre> ________  _______  ________
| Lowest || [Low] || Lowest |
</pre>


= Bugs =
= Bugs =
* {{bug|514490}} Actual implementation bug
* {{bug|511503}} Window activate/deactivate DOM events


= Resources =
= Resources =
* [http://groups.google.com/group/mozilla.dev.apps.firefox/browse_thread/thread/94bf663f787b711e Limi's dev.apps.firefox thread] (has some useful implementation insight from bz)
* [http://groups.google.com/group/mozilla.dev.apps.firefox/browse_thread/thread/94bf663f787b711e Limi's dev.apps.firefox thread] (has some useful implementation insight from bz)

Latest revision as of 19:50, 26 October 2009

Overview

Sprint lead: zpao

Sprinters: zpao, limi

QA Contact: whimboo

Description

We want to do some network prioritization such that the tab / window that you are currently using have higher network priority than the ones you aren't using.

The goal is to optimize tab loading and performance on startup.

We propose to do this in two stages:

  • Firefox 3.6: A simple enhancement where we assign priorities to the network loading of the different tabs. This should give us a quick win and make the initial page load of the focused tab complete earlier.
  • Firefox 3.7: A more comprehensive enhancement to make it possible to load tabs in most-recently-used order, as well as possibly set a threshold for how many tabs get loaded at once. This should take care of the more extreme cases where people are opening 30+ tabs on restore.

Goals / Use Cases

  • Make Firefox feel like it's starting up faster.
    • While Firefox (or at least the tab / window being used) should become more immediately usable, I don't think total load time will be faster.
  • Make current tab more responsive than background tabs.

Non-Goals in this iteration

The first iteration will be a simpler version, for the next iteration (3.7?) we should consider:

  • MRU network prioritization.
  • A threshold on how many tabs are loaded in parallel to control cpu/network load.
  • Batch up these groups based on MRU order.

Design

There are a couple ways we could do this:

  • Put it all in tabbrowser.xml & browser.js & just jigger priorities directly.
  • Put it in a new component (or whatever) that listens for TabSelect (and window select)

If possible, we also want to be able to have an interrupt give higher priority to a tab if you switch to it during the initial page load. E.g. if you switch to the unfocused window, the priorities mirror what was in the initial focused window had, and the now-unfocused window has its priorities downgraded.

Prioritization

Priorities

Priorities range from 20 to -20 with -20 being the highest. There are 5 presets (highest, high, normal, low, lowest).

What To Do With Priorities

The general proposition here is as follows:


Focused Tab Unfocused Tab
Front-most Window high normal
Background Window normal low
Minimized Window low

lowest

A visual way of looking at it — [] indicates frontmost tab:

Focused window:

 ________  ________  ________ 
| Medium || [High] || Medium | 

Unfocused (but visible) window:

 _____  __________  _____ 
| Low || [Medium] || Low | 

Minimized window:

 ________  _______  ________ 
| Lowest || [Low] || Lowest |

Bugs

Resources