[Linux] Firefox performance tip
10 ianuarie, 2009
Just found this and thought i had to share it:
Firefox insists on doing huge amounts of I/O when closing, as well as act slow when using the awesomebar, try the following (close down Firefox completely first):
for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done
It’s harmless, no data will be lost: it compacts your SQLite databases. Noticable gains for me.
[Source]
18 comentarii
Comentariile nu sunt permise.


works, thanks
You’re welcome.
Can you explain how to do this?
There is a program with the command. Make sure that the single-quotes around VACUUM are correct. The command if copy and pasted doesn’t work. Not for me anyway. The Following command worked for me:
for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f ‘VACUUM;’; done
I can’t get it to work. I get error:
SQL error: near “‘VACUUM”: syntax error
bash: ’: command not found
You are right, remu, when I typed it in, instead of copy & pasting, it worked.
Thanks!
I don’t know why you can’t copy/paste because that’s exactly how i did it. Maybe wordpress modified it
I edited it and used some code tags, hope it works now…
Does this accomplish the same as using the compact database feature of SQLite Manager?
copy/paste to a notepad. after that copy paste from the notepad. It should work. copy paste directly u get this message”SQL error: near “‘VACUUM”: syntax error
bash: ’: command not found”.
Anyone know’s a similar trick for windows?
I don’t think Windows uses MSQLite databases for Firefox
I’m not sure I follow this.
Does one simply run this in the command line once and then your settings are changed so the MSQLite databases are cleared every time?
Or do you need to do this each time you close Firefox?
Or does one need to put this into a file or script somwhere?
You can have it to start once you login (startup). You will notice that the awasomebar is a lot more responsive and also Firefox will close down much faster than before.
`for x in …` is generally a bad idea. You should use `find` instead
> find ~/.mozilla/ -iname ‘*.sqlite’ -execdir sqlite3 {} ‘vacuum;’ \;
Why? Well, it worked ok with ‘for’ too…
?
Okay, now my search bar doesn’t work and I can’t auto-complete when I press Ctrl-Enter in the address bar.
You must have entered something else because i have
for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f ‘VACUUM;’; done
on startup for a few months now and everything is ok!
Have you completely close Firefox first?
I guess this is the same as the Vacuum option in BleachBit? http://bleachbit.sourceforge.net/