If your Firefox insists on doing huge amounts of I/O when closing, as well as acts slow when using the awesomebar,you can try this great tip original from:http://weblog.savanne.be/153-performance-tip-of-the-day

First,close down your Firefox completely and try following in Applications->Accessories->Terminal:

for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done

this command just compacts your SQLite databases and no data will be lost.(You may first type sudo apt-get install sqlite3 to make this command run well.)

In addition,for OS X you can try:

for f in ~/Library/Application Support/Firefox/Profiles/*/*.sqlite; do sqlite3 "$f" 'VACUUM;'; done