Speed up Firefox by optimizing prefs.js

Posted on January 9th, 2008

I have lost count of the number of Firefox add-ons that I have installed since the beginning. Many of them add entries to the file prefs.js which is located in the Firefox profile folder. Unfortunately though these entries are not removed once you make the decision to uninstall the add-on in Firefox.

This means that you will accumulate lots of entries from add-ons in prefs.js that do nothing but waste space and could slow down Firefox this way. You probably have noticed that Firefox loads and behaves much faster if you create a new profile and use this to surf the web. This is due to two reasons.

First, no extension is loaded because none is installed yet. Second, all the entries that point to old extensions in prefs.js are also gone and not available in the new profile. Cleaning the prefs.js file is unfortunately not that easy as it sounds. You can load the file into a text editor but deleting a needed entry could corrupt Firefox.

Create a backup of the file first and make sure you close Firefox before you start removing lines. Firefox will update the file when the user closes the browser.

My approach was to look at each line and delete the lines that contained an add-on name that I was surely not using anymore. I was able to reduce the size of prefs.js from 440 Kilobytes to 310 Kilobytes this way. And I’m sure that I missed some lines but I did not want to take the risk and delete a line that is still needed.

Posted under: Firefox, Tips

1 Comment

MyAvatars 0.2

Transcontinental said...

...on January 9, 2008 @ 5:40 pm

I’ve taken the habit of cleaning prefs.js everytime I remove an extension, and though it easy when the occurrences of the extension meet the extension’s name, it is sometimes less obvious when those occurrences have a contracted form far from their name…
As for speed and stability, there is also a good method available, which is (Firefox being closed), to delete these 3 files located in the user profile, :
extensions.cache
extensions.ini
extensions.rdf
These 3 files will be rebuild (will require a few seconds) on next Firefox launch, cleaned up of possible inconsistencies.

Leave a reply...