Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Firefox Optimization Guide.


Firefox Optimization Guide.

By ghostghost | 5258 Reads |
0     0

HTTP Connection Settings

These settings control the number of opened HTTP connections allowed by Firefox. It is possible to improve firefox's speed by raising them. If you do raise them, do it sensibly as it increases the load on the server which can slow it down or lead to your connections being blocked.

network.http.max-connections = 48 Sets the maximum number of HTTP (web) connections allowed by the browser. When you navigate to a webpage the browser will request one or more actual pages and probably a bunch of image and support files (such as CSS or script files) for each request a separate connection is established. Raising the max-connections allows more of these connections to be established at once, think of it as like adding more lanes to a road. The default is already 24, however for most people on moderate to fast Internet connections you can try raising this to a value like 48 or even 96 to allow for more open connections, thereby speeding up browsing multiple pages.

network.http.max-connections-per-server = 16 Sets the maximum number of HTTP (web) connections that will be made to a single server. The more connections you can establish to a server the more objects (such as web page, image, etc) you can download at once. The default is 8 though I generally recommend increasing this to 16 however setting it higher is unadvisable as it puts an increased burden on the site you are connecting to. Due to this many sites now block users that make more than 16 simultaneous connections.

network.http.max-persistent-connections-per-proxy = 8 Sets the maximum number of persistent or 'keep-alive' connections that work via a proxy. Normally once a connection has dealt with the request it is automatically terminated by the server. Keep-alive connections are not terminated; this has the benefit of speeding future transfers with the site because the connection does not have to be re-established. Not all websites support this feature. I recommend setting this to 8 which is double the default.

network.http.max-persistent-connections-per-server = 4 Sets the maximum number of persistent or 'keep-alive' connections that work via a proxy. Normally once a connection has dealt with the request it is automatically terminated by the server. Keep-alive connections are not terminated; this has the benefit of speeding future transfers with the site because the connection does not have to be re-established. Not all websites support this feature. I recommend setting this to 4 which is double the default. I have found with higher settings you keep-alive connections are often refused.

HTTP Pipelining Settings

Pipelining is a feature found in HTTP/1.1 that speeds up transferes by requesting several objects at once without waiting for a response first.

network.http.pipelining = true Enables pipelining on connections that don't pass through a proxy. Normally HTTP requests to the same site are issued sequentially, this meaning each request for an object (page, image, etc) to be completed before the next one is sent. On slow networks this can result in a significant delay before the next request is seen by the server let alone replied to. Pipelining speeds up tranferes by requesting several objects at once without waiting for a response first.

network.http.pipelining.maxrequests = 8 Sets the number of consecutive requests allowed in one pipelining. The default is 4 but I recommend doubling this to 8 which is the limit Firefox allows, anything higher will have no effect (see nsHTTP.h in the Firefox source)

network.http.proxy.pipelining = true This enables the pipelining feature on connections that go through a proxy server.

Parsing/Rendering Settings

These settings configure Firefox's rendering engine (often called Gecko, officially named NGLayout) NGLayout is the part of Firefox responsible for displaying the webpage. It takes web content (HTML, XML, image files, etc) and style or formatting information (CSS, XSL, etc) and the "paints" the formatted content into Firefox's browser window for display.

content.interrupt.parsing = true This setting enables the interruption of the parsing (reading of HTML/XML) process so Firefox can return to its event loop (the buffer where user input is kept) to check for updated commands. This defaults to true and should always be left as such.

content.max.tokenizing.time = 3000000 This setting determines the amount of time that passes before parsing is interrupted to return to the applications event loop. The default is 2250000 but I recommend a setting of 3000000 which will improve rendering speeds whilst keeping Firefox responsive.

content.maxtextrun = 8191 This setting in part determines when to display a new portion of text to the layout from the buffer.

content.notify.backoffcount = 5 This sets the limit of initial reflows allowed before the rendering engine of Firefox (NGLayout codenamed Gecko) will wait before the calculation for the layout of the larger parts is finalised to do a final reflow.

content.notify.interval = 750000 Firefox buffers network data for a brief period, 120000 microseconds by default, before displaying it. Lowering this setting can improve display speed in Firefox; however it will also increase CPU usage to do so. I recommend a setting of 750000 but no lower as this can drastically reduce the overall speed of Firefox. (See nsHTMLContentSink.cpp in the Firefox source for more info)

content.notify.ontimer = true HTML uses a flow based layout model, meaning that most of the time it is possible to compute the layout or geometry of the page in a single pass. Elements later in the flow\'\' typically do not affect the geometry of elements that are earlier in the flow'', so layout can proceed left-to-right, top-to-bottom through the document thanks to websites using a page metaphor. There are exceptions to this rule: most notably, HTML tables may require more than one pass or it might be that the page is very large and Firefox has started rendering so the user gets to see something. With these exceptions Firefox will have to re-render part or all of the page (reflow). This setting tells Firefox to use a timer based reflow. This setting defaults to true, do not change it.

content.switch.threshold = 750000 This sets how long Firefox waits for user input (mouse or keyboard input) before switching to a less-responsive but less system-intensive low frequency mode. The default is 750000 milliseconds. If you raise this value it might keep Firefox more responsive after long periods of inaction but it will come at the cost of greater system load. For modern systems I don't recommend changing this value it doesn't seem to make a positive difference in performance.

nglayout.initialpaint.delay = 750 This setting determines how many milliseconds, 250 by default, Firefox should way before it starts to display the page contents. Many tweaking forums advise setting this to 0 for best performance, however while this does mean that the first parts of the page appear far quicker the time taken for the whole page to load will be far longer. This is because Firefox will start to render the page before its finished transferring for sites with features such as tables, frames, etc this will mean Firefox will have to recalculate the layout and re-render the page several times, hence the delay before the whole page appears (this is also responsible for the "jumping" of items on a page some users may have encountered) it also raises the cpu usage of Firefox. Due to this I recommend a setting 750, this is still fast but allows Firefox to collect most if not all of the layout code of the webpage, it also synchronises with content.notify.interval for maximum efficiency. Those with very fast computers and networks may want to try a lower setting such as 500.

Memory Settings

The following settings aim to optimise the way Mozilla Firefox makes use of your computers memory.

browser.cache.memory.enabled = true This setting works in conjunction with the browser.cache.memory.capacity setting. When set to true, Firefox will cache some of its program code and data in system memory (RAM) to improve its rendering speed and responsiveness to the user. If set to false, Firefox will not use any RAM to cache, resulting in a performance drop. I highly recommend setting this to true.

browser.cache.memory.capacity = see below This sets how much system memory (RAM) Firefox will use to cache itself, improving performance. There are several values you can enter: 0 = this turns off caching into system memory (RAM) and is not advisable for best performance. 16384 = 16Mb, I recommend this setting for computers with 128 Mb or less RAM 32786 = 32Mb, I recommend this setting for computers with 256 Mb or more Ram 65536 = 64Mb, I recommend this setting for computers with 512 Mb or more Ram -1 = this tells Firefox to determine the amount of RAM to use as a cache (default) This often leada Firefox hogging system memory that could be better spent serving documents/data or other programs. Hence I do not recommend this setting.

browser.session.history.max_viewers = 5 This setting increases the speed of page loading when using the forward/backwards buttons. It instructs Firefox to use some of its cache to keep the last few pages you have viewed in memory meaning they don't have to be read from the hard drive or re-rendered. Because it stores the complete rendered page the amount of memory used is tiny so I highly recommend turning this feature on. This feature is only available on Firefox 1.5 Alpha and Beta builds, when 1.5 is released for general use this setting will have been replaced by browser. sessionhistory. max_total_viewers

config.trim_on_minimise = false Like many applications, when you minimize it to the taskbar, Firefox reduces its system memory usage. While this is of some use for people with very little RAM or who run lots of applications simultaneously, for most people I would recommend setting this to false so Firefox does not constantly attempt to reduce/reclaim its RAM. This will speed up minimizing/maximising operations. This setting only applies to users running Microsoft Windows.

Comments
ghost's avatar
ghost 18 years ago

Nice. ;)

ghost's avatar
ghost 18 years ago

Great article! :p