Archive
How to speed up Firefox
Problem
I’ve had some problems recently with Firefox 6: sometimes it freezes for a few seconds, the CPU usage jumps up to 100%, then everything goes back to normal. It gets annoying when it happens in every 10 minutes…
Solution
I looked after the problem and found some tips.
Delete cache
The cache can grow quite big, so delete it:
https://support.mozilla.com/en-US/kb/How%20to%20clear%20the%20cache
Vacuum SQLite
Firefox stores your browsing data and some other stuff in SQLite databases. These database files must be maintained sometimes to wipe old junks out of them. Go to ~/.mozilla/firefox/XXXXXXXX.default where you will find the .sqlite files (places.sqlite, etc.). Execute the following command:
$ for i in *.sqlite; do echo "VACUUM;" | sqlite3 $i ; done
This operation compacted my places.sqlite from 10.2 MB to 1.8 MB!
This tip is from here.
Update (20110924)
To tell the truth, the methods above didn’t solve the blocking problem on my laptop. So I moved on to Firefox 7 with an empty ~/.mozilla folder. I think something got messed up in my mozilla home folder and the blocking problem was due to that. After all, I’ve been using that folder for years… Sometimes it’s a good idea to start with a tabula rasa.
Connect to sqlite3 databases and make queries
Problem
You have a binary sqlite3 database file and you want to make some queries on it: find out what tables it has, look at the content of the tables, etc.
Solution
There is a command called “sqlite3” which is a client for sqlite3 databases. Let’s say our database is stored in a file called “database.sqlite“. (Here “.sqlite” is the file extension.)
# open database.sqlite with the client: sqlite3 database.sqlite # let's get the list of tables in this database: .tables # Say it has a table called "images". Let's see its content: select * from images;
To learn more about the commands, just type “.help” in the client. You can dump a database in SQL text format, you can get the schema of a table, etc.
Tip
Although .sqlite database files are binary files, you can open them with a text editor too. At the top you can see the schemas of the tables in text format. Just be careful not to modify it.
Create a database from a schema (update 20111120)
sqlite3 database.sqlite < schema.sql