Intermediate Form

Mozilla Speedup

Previous Entry | Home | Next Entry

There's a simple preference fix that improves the apparent speed of the Mozilla web browser. To reduce CPU usage, Mozilla (and derived web browsers, like phoenix) delays the initial rendering of a web page when a page has not been fully loaded. While this might make sense in some cases, at least in my experience CPU time is cheap and the user's time is expensive. On many pages, important content is visible at the top of the page even before the entire page has been loaded.

Mozilla is nothing if not customizable. This behavior can be changed, and doing so has, in my experience, made the browser seem quite a bit snappier. To change the preference:

  1. Enter about:config into the location bar.
  2. Right-click, pick "New", then "Integer".
  3. Enter in "nglayout.initialpaint.delay". (Leave off the quotes.)
  4. Enter in "5".

The change will take effect immediately, without a restart. While most pages will render more quickly, the cost is an occasional reflow which causes text to jump around on the page. You can change the 5 there to something else, to prevent that. But I think it's worth the speedup.


There's a big discussion about this on the mozillazine forums, but I like it enough to mention it here.

- Tom | permalink | changelog | Last updated: 2003-06-13 21:51

Previous Entry | Home | Next Entry


Posted on Friday, June 13, 2003 by Chris:

It does seem to help. I presume that it will be more of a help on larger pages, and probably also with a better broadband connection.

Posted on Friday, June 13, 2003 by Asa:

This setting has nothing to do with CPU time. This setting is to optimize the balance between the total page loading time and trying to get something usable on the screen as quickly as possible.

If you start laying the page out before you any good information about what the page will ultimately look like (information pulled from the network, pumped through the parser and handed off to layout) then you have to repeated reflow the page as new information comes in. Reflowing the page takes time and isn't visually very pleasant. The more of these reflows that you have to do the longer the page takes to load and the more things shift around as it makes the reflow passes. So, setting that value to really low or zero may get the first bits on the screen faster but the overall time it takes to completely display the page will be reduced (sometimes dramatically) and it'll likely do a lot more shifting and squirming as it incrementally displays. We've tested various times for this value and found a quarter second (the current default) to be a nice balance between getting something onto the screen quickly and not having to reflow pages so many times as to slow the complete load time down too much. You're certainly free to tweak that setting but it's worth understanding the tradeoff if you plan to do so, if nothing more so that you don't wonder why the page takes so long to _complete_ loading or why it shifts around so much. --Asa

Posted on Friday, June 13, 2003 by Tom:

Hm... I haven't noticed many problems with reflowing, but then again, I've only been running this setting for a day or so.

I wonder if this functionality could be made smarter, so that it's not required to wait the full time for all pages, or to use a default small value and backoff if it's not appropriate for a page.

Commenting has been suspended due to spam.