[Linux] Firefox performance tip

2009 ianuarie 10
by Andrei

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]

17 Responses leave one →
  1. 2009 ianuarie 10

    works, thanks

  2. 2009 ianuarie 10

    You’re welcome.

  3. 2009 ianuarie 10
    deepak permalink

    Can you explain how to do this?

  4. 2009 ianuarie 10
    remu permalink

    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

  5. 2009 ianuarie 10
    ChrisBookwood permalink

    I can’t get it to work. I get error:

    SQL error: near “‘VACUUM”: syntax error
    bash: ’: command not found

  6. 2009 ianuarie 10
    ChrisBookwood permalink

    You are right, remu, when I typed it in, instead of copy & pasting, it worked.

    Thanks!

  7. 2009 ianuarie 10

    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…

  8. 2009 ianuarie 11
    Kevin permalink

    Does this accomplish the same as using the compact database feature of SQLite Manager?

  9. 2009 ianuarie 11
    mcwood permalink

    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”.

  10. 2009 ianuarie 24
    Jan permalink

    Anyone know’s a similar trick for windows?

  11. 2009 ianuarie 24

    I don’t think Windows uses MSQLite databases for Firefox :)

  12. 2009 martie 27
    Broderick permalink

    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?

  13. 2009 martie 27

    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.

  14. 2009 martie 28

    `for x in …` is generally a bad idea. You should use `find` instead :)

    > find ~/.mozilla/ -iname ‘*.sqlite’ -execdir sqlite3 {} ‘vacuum;’ \;

  15. 2009 martie 28

    Why? Well, it worked ok with ‘for’ too… :-? ?

  16. 2009 martie 28
    MuffinTop permalink

    Okay, now my search bar doesn’t work and I can’t auto-complete when I press Ctrl-Enter in the address bar.

  17. 2009 martie 28

    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?

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS