Sunday, February 15, 2009

Firefox is slow - how to make it faster?

Firefox was quite slow and had the following symptoms:
  • A delay when resolving host names
  • A couple-second delay when switching between tabs
  • Slow scrolling inside the page
I did some research and tweaking, and now it runs blazingly fast. This post is here as a reference if I ever have to do it again.

My current setup:
  • Sony VAIO notebook
  • Nvidia videocard
  • Linux Ubuntu 8.04 Hardy Heron
  • Firefox 3.06 - 3.1 beta - both were lagging about the same
What I did:

Disable IPv6

(this helps with DNS responses from sites)
  1. Type about:config in Firefox address-bar
  2. If needed, press I'll be careful, I promise button :)
  3. Type network.dns in the Filter field, find network.dns.disableIPv6 value in the list below and double-click on it to make it change to True

Speed-up page loading times by increasing the amount of http request Firefox issues simulataneously

  1. On the same about:config page 
  2. Type network.http.p in the Filter field
  3. Set network.http.pipelining to True
  4. Set network.http.proxy.pipelining to True
  5. Increase network.http.pipelining.maxrequests value to about 16-20 from the default 4. 


Tell Firefox to start drawing page immediately after it receives some part of it from the server

  1. Right-click somewhere in about:config window
  2. Choose New->Integer from the context menu
  3. Name it nglayout.initialpaint.delay
  4. Set it to "0"

If you are an Ubuntu user with Emerald

update your Nvidia driver (this can give drastic performance boost)

Even if you have automatic updates on, you might still have old Nvidia drivers. There is a known interoperability issue between Nvidia drivers and Emerald, so you can either switch to another window decorator, or update drivers.
The easiest way to do it is to use EnvyNG:
  1. Install envyng-gtk if you use Ubuntu/Gnome:
    sudo apt-get install envyng-gtk
    or envyng-qt if you use Kubuntu/KDE:
    sudo apt-get install envyng-qt
  2. Launch Applications->System tools->EnvyNG
  3. Choose NVIDIA->Install the NVIDIA driver (Automatic Hardware Detection)
  4. Press Apply and then restart your computer when asked.

Firefox should be now faster than lightning.


said thank you for this page

Liked this article? Bookmark/share it with others: Didn't like the article, found a mistake or just want to express your own opinion? Post a comment!


tortaschilangas said...

is it still working....? i think the new opera is quite fast with flash on, i 'll try this trick.. :D

Post a Comment

Have anything to say? Leave a comment!
Too shy or got a too private question? Email me
Alternatively, you can drop me a line on Twitter