I have found, after I’ve been using Firefox for an extended period of time, that it slows right down and starts to become quite a bad memory hog.
This can be resolved by compacting your SQLite database. Close down Firefox first and then past this command into a terminal window:
for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done
Voila! Your Firefox is as good as new