Skip to Main Content

Make Firefox Faster by Vacuuming Your Database


Firefox tip: Firefox 3.0's Awesome Bar added all kinds of features to the 'fox, but unfortunately it's also created some performance issues—for example, by upping the default history time, leading to larger, fragmented databases. This quick hack speeds things up.

All-things-Firefox weblog Mozilla Links previously detailed how to defragment SQLite databases with a vacuum command, but the whole process was a bit clumsy, and it required a restart. Now they've updated the technique with a simple bit of code you can run inside Firefox's Error Console that requires no restart.

Open the Error Console:

Tools

menu/

Error Console

In the

Code

text box paste this (it's a single line):

Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");

Press

Evaluate

. All the UI will freeze for a few seconds while databases are VACUUMed

Once the process is complete, you should notice a big improvement in performance, especially when using the Awesome Bar to search for a web site. While you're tweaking away, you may also want to take a look at how you can speed up Firefox by limiting your history size.

Vacuum Firefox databases for better performance, now with no restart [Mozilla Links]