Friday, December 1, 2006

Increasing pipelines for a faster Firefox

Recently, the YUI team conducted an experiment on optimizing web page performance. Though the results are not ground-breaking, it is interesting to see the figures. Using the Pareto principle, which says 80% of the effects is achieved by 20% of the causes, the YUI team discovers where this 80% is.
Table 1 shows popular web sites spending between 5% and 38% of the time downloading the HTML document. The other 62% to 95% of the time is spent making HTTP requests to fetch all the components in that HTML document (i.e. images, scripts, and stylesheets). The impact of having many components in the page is exacerbated by the fact that browsers download only two or four components in parallel per hostname, depending on the HTTP version of the response and the user’s browser. Our experience shows that reducing the number of HTTP requests has the biggest impact on reducing response time and is often the easiest performance improvement to make.

What is network pipelining? Mozilla gives a good explanation here. One way to increase the number of pipelines for Firefox from the default of 4 is to type "about:config" in the address bar. In the filter bar, check that "network.http.pipelining" is true. Then filter for "network.http.pipelining.maxrequests" and set it to a value you desire. I entered 7 and felt Youtube loaded faster. Didn't really test the effects empirically though. It's not always the case that a higher value is better though. It's stated in mozillaZine that,
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.

No comments:

Post a Comment