The purpose of this thread is to collect and discuss various tuning options for Gecko based browsers and correct some of the more obvious mistakes in several tweak collections that are circulating on the web. Note that I'm not a Gecko developer, so take the information in this post with a grain of salt. Anybody who's able to fill in the holes or correct errors is most welcome, as well as additional useful preferences. Happy tuning.
Parsing/Rendering Preferences:
Warning: these options actually exist for internal fine-tuning and debugging purposes and are not meant to be changed by the normal user. They are kind of Voodoo to anyone not intimately familiar with Gecko, because they are not explained anywhere outside of the source.
The default values are as optimized as possible for a wide range of different connection types and system speeds. Experimenting with some of the values might improve perceived rendering speed by forcing Gecko to show page contents earlier, but might also have a reverse influence on total page load times. Test thoroughly on your system, as far as it is possible.
nglayout.initialpaint.delay
- Description: time to wait before an initial reflow attempt during page rendering (?)
- Type: integer
- Unit: milliseconds
- Default: 250
- Recommendation: keep in synch with content.notify.interval (?)
- Description: enable timer-based reflows during page rendering (?)
- Type: boolean
- Default: true
- Recommendation: leave on default.
- Description: time steps for the initial reflows defined by content.notify.backoffcount (?)
- Type: integer
- Unit: milliseconds * 1000 (?)
- Default: 120000
- Additional Info: nsHTMLContentSink.cpp, Bug 72138
- Recommendation: do not set this below 100000. Synchronize with nglayout.initialpaint.delay (?) In contrary to what other tweak examples say, setting this to 100 is absurd.
- Description: number of initial reflows during timer-based rendering (?) After this number the page is only reflowed when the calculation of the layout of larger parts of the page is finalized (?)
- Type: integer
- Default: -1 (never)
- Example: 10
- Additional Info: nsHTMLContentSink.cpp
- Recommendation: experiment with some values depending on the bandwidth/latency of your connection and overall system speed.
content.switch.threshold
- Description: (?)
- Type: integer
- Unit: milliseconds * 1000 (?)
- Default: 750000
- Additional Info: nsHTMLContentSink.cpp
- Recommendation: keep in synch with nglayout.initialpaint.delay and content.notify.interval (?)
- Description: (?)
- Type: integer
- Unit: kilobytes (?)
- Default: 8191
- Additional Info: nsHTMLContentSink.cpp, Bug 77540
- Recommendation: leave on default.
- Description: enable interruption of parsing to return to the application's event loop from time to time (?)
- Type: boolean
- Default: true
- Recommendation: leave on default.
- Description: time after which parsing is interrupted to return to the application's event loop (?)
- Type: integer
- Unit: milliseconds * 1000 (?)
- Default: 3 * content.notify.interval
- Example: 2250000
- Additional Info: nsHTMLContentSink.cpp, Bug 76722
- Recommendation: leave on default. Lowering this might make Firefox more responsive during loading of large pages, but might also raise total page load times. If you change this, make it a multiple of content.notify.interval.
HTTP Connection Preferences:
These options control the number of opened HTTP connections. If you raise them, do it reasonably. Changes like these are at least partly responsible for the infamous /. effect.
network.http.max-persistent-connections-per-server
- Description: maximum number of persistent (keep-alive) connections per server.
- Type: integer
- Default: 2 (as per recommendation in HTTP/1.1 specification)
- Recommendation: none
- Description: maximum number of persistent (keep-alive) proxy connections.
- Type: integer
- Default: 4 (as per recommendation in HTTP/1.1 specification)
- Recommendation: none
- Description: maximum number of HTTP connections of any type to a single server.
- Type: integer
- Default: 8
- Recommendation: none
- Description: maximum number of total HTTP connections.
- Type: integer
- Default: 24
- Recommendation: none
HTTP Pipelining Preferences:
Pipelining is a HTTP/1.1 feature that speeds up transfers by requesting several objects at once without waiting for a response first. More info...
network.http.pipelining
- Description: enable pipelining for non-proxy connections.
- Type: boolean
- Default: false
- Additional Info: might still lead to problems with servers that don't support pipelining correctly and that are not on the internal blacklist.
- Recommendation: true
- Description: enable pipelining over a proxy.
- Type: boolean
- Default: false
- Additional Info: see network.http.pipelining.
- Recommendation: true
- Description: maximum number of consecutive requests in one pipeline.
- Type: integer
- Limit: 8
- Default: 4
- Additional Info: nsHTTP.h. Optimal value depends on connection bandwidth/latency.
- Recommendation: 8. While it doesn't hurt to set it to 100 like in other tweak examples, it will have no effect whatsoever because of the mentioned limit.
- Description: enable pipelining on first request to a server.
- Type: boolean
- Default: false
- Additional Info: since it doesn't seem to get picked up anywhere in the source, this preference doesn't seem to be used. First requests are obviously never pipelined.
- Recommendation: do not use this preference. While it probably doesn't hurt, it will have no effect either.
Useful Cache Preferences:
browser.cache.memory.capacity
- Description: amount of memory assigned to memory cache.
- Type: integer
- Unit: kilobytes
- Default: 4096 in older builds, dynamically assigned depending on total amount of memory in newer builds (?).
- Recommendation: set this to a high fixed value if you have enough RAM to noticeably improve back/forward button performance while going many steps back/forward (?)
- Description: amount of disk space assigned to disk cache.
- Type: integer
- Unit: kilobytes
- Default: 50000
- Recommendation: none
- Description: switch to enable caching of objects served over a secure connection (SSL).
- Type: boolean
- Default: false
- Recommendation: true on systems where it is secure to cache these objects.
- Description: path to parent directory of Firefox' disk cache.
- Type: string
- Default: profile folder
- Additional Info: use double backslashes as path separators in Windows. Not existing directories will be created if they don't exist.
- Example: E:\\Folder1\\Folder2
- Recommendation: none
Useful Miscellanous Preferences:
browser.xul.error_pages.enabled
- Description: use an error page instead of a modal dialog when a connection error occurs.
- Type: boolean
- Default: false
- Additional Info: Bug 28586. This is not enabled by default because the implementation lacks some functionality.
- Recommendation: true (in combination with Show Failed URL)
- Description: show full path to plugins in about:plugins.
- Type: boolean
- Default: false
- Recommendation: true
- Description: this is a preference to be used while developing scripts that need enhanced privileges. It allows potentially security-critical JavaScript to bypass the signing stage (?)
- Type: boolean
- Default: false
- Recommendation: unfortunately setting this to true this is the only working way I'm aware of to selectively grant JavaScript access to the clipboard. The user will still be asked everytime a script/applet requests access to privileges. If you're using this, be sure to only grant access for scripts/hosts you trust, otherwise this can be a huge security risk, because it opens your system to virtually everything (!!!)
----------------------------
Changing these preferences can either be done by user.js or by about:config. The most comprehensive collection of preferences including descriptions can be found here.
----------------------------
Testing the options that influence rendering speed and total page load time isn't easy for normal users.
One possible method is to locally save a large page and then load it from disk, measuring time by a JavaScript onload handler or with a stopwatch.
Another method is to use an online speed tester like http://www.numion.com/stopwatch.
Neither of these methods will lead to results that are comparable among different connections and systems. Further suggestions or example pages are most welcome.
----------------------------
Finally, here are the values I use at the moment on dialup and a fast machine (AthlonXP @ 2GHz) for the set of preferences in this post:
browser.cache.memory.capacity : 65536
browser.cache.disk_cache_ssl : true
browser.xul.error_pages.enabled : true
content.interrupt.parsing : true
content.max.tokenizing.time : 3000000
content.maxtextrun : 8191
content.notify.backoffcount : 5
content.notify.interval : 750000
content.notify.ontimer : true
content.switch.threshold : 750000
network.http.max-connections : 32
network.http.max-connections-per-server : 8
network.http.max-persistent-connections-per-proxy : 8
network.http.max-persistent-connections-per-server : 4
network.http.pipelining : true
network.http.pipelining.maxrequests : 8
network.http.proxy.pipelining : true
nglayout.initialpaint.delay : 750
plugin.expose_full_path : true
signed.applets.codebase_principal_support : true
As an example, these settings locally render scragz' table test in an average of about 2.4 seconds compared to an average of about 3.4 seconds with Firefox' default settings on my system, that's an improvement of almost 30% in this specific test, while starting rendering earlier than with the default settings. For more info on this see scragz' original post.
----------------------------
Disclaimer: I don't take any responsibilty for any damages whatsoever caused to you or anybody else by changing these preferences on your copy of Firefox or any other Gecko based browser. Have fun ;)
Edited to update the information for "signed.applets.codebase_principal_support".