Sunday, August 9, 2009

Firefox database performance improvement

hi, my first post. :)

here we go.

After some time firefox gets sluggish. You can reach a better performance by optimizing the internal used databases where firefox save bookmars, formdata etc..

You can use sqlit3 commandline tool to optimize its performance.

sqlite3 DATABASE* VACUUM
sqlite3 DATABASE* REINDEX
*Databasename

You have to close firefox to use this method.

You can use this script so optimize all database files at once: (this script looks if firefox is running. Maybe its necessary to change the path to your firefox binary)

#FIREFOX-OPTIMIZE
#!/bin/sh

if [ `whereis sqlite3 | grep -c /` -lt 1 ]
then
echo ‘sqlite3 program is necessary to this script. Install it with:’;
echo ‘\tsudo apt-get install sqlite3′;
exit 2;
fi

if [ `ps aux | grep -c /usr/bin/firefox` -gt 1 ]
then
echo ‘Close Firefox to run this script’;
exit 1;
else
echo ‘Optimizing browser database…’;
echo ‘This can take a while…’;

for i in ~/.mozilla/firefox*/*/*.sqlite; do
sqlite3 $i VACUUM;
sqlite3 $i REINDEX;
done;

echo ‘Optimization succesfully’;
exit 0;
fi

Tip and script found here: (i changed the script a bit)
http://mozillalinks.org/wp/2009/07/vacuum-your-firefox-databases-for-better-performance/

No comments:

Post a Comment