Tuesday, November 9, 2010

Quick trick to speed up Firefox (again)

After a few months of use Firefox tends to slow down and spend more and more time doing disk-IO. The reason is that FF uses sqlite for various things like where you have been and what you have filled into forms. These databases get fragmented, and there is no automatic vacuuming of them (but in Thunderbird it seems this is done automagically, go figure).

This have bothered me from time to to me over the last years, and now it happened again. And this time I thought I could write down the quick fix (for lilnux, probably works with Macs too)

  •    stop Firefox
  •    cd into your firefox profile
  •    for i in `find  . -iname \*sqlite`; do echo " -- $i --"; ls -l $i; sqlite3 $i VACUUM; ls -l $i ; echo; done

This reduced places.sqlite from 21 to 3MB, cookies.sqllite almost halved in size, while some of Firefox's own db's remained unchanged.

And most importantly - Firefox feels a lot quicker now:-)


  1. Thanks! Works fine but requires installed sqlite.

  2. Do you have a fix for FF under MSwindows too? tnx

  3. Carsten; thanks for the reminder - you are of course correct.

    A more complete description of this procedure can be found at


    Anonymous; The article have links for downloading sqlite binaries for both Mac and MS Windows (Linux-users should just use their package manager to install Sqlite) and the article has a script to run this in windows.