Opened 8 years ago

Last modified 16 months ago

#3978 needs_information enhancement

Better TBB about:config settings(?); re: browsing and loading speed, etc.

Reported by: joyton Owned by: mikeperry
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-pref
Cc: jcrimby@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hello,

I have been testing the following about:config settings (specific to Firefox 6) for a couple of weeks. I have used very similar settings for TBB since Firefox v3.x.x. These settings do seem to (very noticeably) speed up browsing, maybe some of these can be migrated into official TBB releases?

The only setting I think may do well with a bit of tweaking is nglayout.initialpaint.delay, I doubled the Firefox defualt of 250 ms. Doing so seems to (noticeably) increase total page load time, while (unnoticeably) reducing time to first load on page.

I tried to test these settings in TBB vs. vanilla TBB but I don't know how to configure Tor to use the same circuit for all speed tests.

Relevant links:

  1. How To Speed Up Firefox 6 Tweaking Guide
  2. Hacking Firefox for Maximum Performance with Tor (some settings are outdated and some settings are missing)

user.js (placed in ...\Tor Browser\FirefoxPortable\Data\Profile)

Spell check works with all fields
user_pref("layout.spellcheckDefault", 2);

default is 250 ms, longer wait time means faster total page load time, but slower initial page loading.
user_pref("nglayout.initialpaint.delay", 500);

Stops the display of placeholders while images are loading to speed up the page. Default is True
user_pref("browser.display.show_image_placeholders", false);

Sets the maximum number of times the content will do timer-based reflows to 5. After this, the page will only reflow once it is finished downloading. This is a new value. Default is -1 (no limit)
user_pref("content.notify.backoffcount", 5);

Sets the minimum amount of time to wait between periodic reflowing of the page to 0.12 seconds – stops Firefox becoming slow by reflowing too frequently. This is a new value. Default is 120000
user_pref("content.notify.interval", 120000);

Sets the maximum amount of time Firefox will be unresponsive while rendering pages – set to 3 times the content.notify.interval above. This is a new value. Default is 360000
user_pref("content.max.tokenizing.time", 360000);

Ensures Firefox does not reflow pages at an interval any higher than that specified by content.notify.interval above. This is a new value. Default is True
user_pref("content.notify.ontimer", true);

Sets Firefox to interrupt parsing a page to respond to UI (user interface) events to prevent it becoming unresponsive until parsing is complete. This is a new value. Default is True
user_pref("content.interrupt.parsing", true);

Sets the number of microseconds of inactivity that puts Firefox into low frequency interrupt mode. This is a new value. Default is 750000
user_pref("content.switch.threshold", 750000);

Disables IPv6 DNS lookups to prevent a significant delay with poorly configured IPv6 servers.
user_pref("network.dns.disableIPv6", true);

This preference takes values between 1 and 255 inclusive, directly corresponding to the maximum number of HTTP keep-alive connections the application can have open at once to the proxy server. Default is 8.
user_pref("network.http.max-persistent-connections-per-proxy", 16);

Increases the maximum number of persistent connections per server which can help speed up loading of multimedia rich sites. This settings must be equal to, or greater than, "Network.http.max-persistent-connections-per-proxy". Default is 15.
user_pref("network.http.max-connections-per-server", 16);

Amount of time in seconds to keep keep-alive connections alive. Default is 115 seconds.
user_pref("network.http.keep-alive.timeout", 600);

[! Not needed: TorBrowser already has correct configuration] Use keep-alive connections whenever possible.
user_pref("network.http.proxy.keep-alive", true);

[! Not needed: TorBrowser already has correct configuration] Stops Firefox automatically prefetching (loading) the contents of pages linked to by the page you are viewing – in most cases you will never visit those links so this time is wasted and it is a security risk because you are unwittingly downloading (possible virus/adult) content only linked to by the current page but which you have not chosen to load. Default is True.
user_pref("network.prefetch-next", false);

[! Not needed: TorBrowser already has correct configuration] Can send multiple requests to a server together in order to speed up loading of webpages. This is not supported by ALL servers – some servers may even behave incorrectly if they receive pipelined requests. Default is False
user_pref("network.http.pipelining", true);

[! Not needed: TorBrowser already has correct configuration] Can send multiple requests to a server together in order to speed up loading of webpages. This is not supported by ALL servers – some servers may even behave incorrectly if they receive pipelined requests. Default is False
user_pref("network.http.pipelining.ssl", true);

[! Not needed: TorBrowser already has correct configuration] Can send multiple requests to a server together in order to speed up loading of webpages. This is not supported by ALL servers – some servers may even behave incorrectly if they receive pipelined requests. Default is False
user_pref("network.http.proxy.pipelining", true);

[! Not needed: TorBrowser already has correct configuration] Sets a maximum number of multiple requests that can be pipelined to prevent overloading the server. Higher values will cause a delay before the first request completes but will make the last request complete sooner. Higher values will also cause more of a delay if a connection fails. Default is 4.
user_pref("network.http.pipelining.maxrequests", 10);

Child Tickets

Attachments (1)

tbb-ff-pgo.patch (2.8 KB) - added by tmpname0901 8 years ago.
Add support for doing a profiled build of Firefox/Linux.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by joyton

Edit:

I wrote:

"The only setting I think may do well with a bit of tweaking is nglayout.initialpaint.delay, I doubled the Firefox defualt of 250 ms. Doing so seems to (noticeably) increase total page load time, while (unnoticeably) reducing time to first load on page."

That is the exact opposite of what I meant to write, sorry! When I use 500 ms for nglayout.initialpaint.delay the total page load time decreases and initial time to first load (paint) on page increases.

comment:2 Changed 8 years ago by mikeperry

Milestone: TorBrowserBundle 2.3.x-stable

We should definitely review these. Some of them may change when we deploy latency optimizations, though.

If we can distill these into a more succinct set of "obviously beneficial for tor and clearly likely to stay that way" , we can bump the milestone up to 2.2.x.

comment:3 Changed 8 years ago by joyton

The two entries I think should be most heavily looked into (with respect to ideal setting for Tor) are: (1) network.http.keep-alive.timeout*, for some reason I think I may make linkability easier with a high setting of 600 seconds; and (2) nglayout.initialpaint.delay, which may provide further speed improvements (re total page load time) with higher setting than 500 ms.

In my expedience with Firefox and Tor over the ~10 years (has it been that long?!) on average initial paint (is that the correct term?) takes longer than 250 ms, which is the default for Firefox v.3.x-6.x. Increasing the time to 500 ms didn't make for noticeably longer time to first paint, but did make for noticeably faster total page load time. At least for my older low RAM computer and high speed (6MB/s up) asymmetric Internet connection.

  • "HTTP is the application-layer protocol that most web pages are transferred with. HTTP keep-alive connections can be re-used for multiple requests, as opposed to non-keep-alive connections, which are limited to one request. Using keep-alive connections improves performance. This preference determines how long keep-alive connections are kept alive." http://kb.mozillazine.org/Network.http.keep-alive.timeout

"Mozilla applications render web pages incrementally - they display what's been received of a page before the entire page has been downloaded. Since the start of a web page normally doesn't have much useful information to display, Mozilla applications will wait a short interval before first rendering a page. This preference controls that interval." http://kb.mozillazine.org/Nglayout.initialpaint.delay


comment:4 Changed 8 years ago by joyton

Edit:

expedience = experience ;) (fwiw, an edit button on track messages would be grand)

Changed 8 years ago by tmpname0901

Attachment: tbb-ff-pgo.patch added

Add support for doing a profiled build of Firefox/Linux.

comment:5 Changed 7 years ago by mikeperry

Status: newneeds_information

Wow, thanks tmpname. I am moving this to Needs Information until someone tries out a profiled Firefox and gets some numbers. Otherwise we're not likely to deviate from Mozilla's defaults here.

Note that we already lowered the keep-alive timeout to 20s for linkability, and I plan to have a better solution for 2.3.x.

comment:6 Changed 6 years ago by tmpname0901

Note to interested readers: with contemporary versions of TBB (e.g. 2.3.25-8) Firefox is not actually run after the initial build, so there is no profiling info to provide benefit for the second linking.

I suspect this due to improved Tor security, that Firefox won't run if TorButton isn't running or some such thing. Or maybe some setting that forces use of a local proxy, which prevents access to the Python webserver used to generate the profiling data. Requires more investigation.

Anyway, the file attached earlier does still do profiled builds of Firefox, but currently provides no benefit to the end user.

comment:7 Changed 3 years ago by bugzilla

Component: Firefox Patch IssuesTor Browser
Keywords: tbb-pref added
Milestone: TorBrowserBundle 2.3.x-stable
Severity: Normal

comment:8 Changed 16 months ago by cypherpunks

[! Not needed: TorBrowser already has correct configuration] Stops Firefox automatically prefetching (loading) the contents of pages linked to by the page you are viewing – in most cases you will never visit those links so this time is wasted and it is a security risk because you are unwittingly downloading (possible virus/adult) content only linked to by the current page but which you have not chosen to load. Default is True.

user_pref("network.prefetch-next", false);

Current TBB have "network.prefetch-next: true". This should be "false" by default.

Note: See TracTickets for help on using tickets.