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:-)