Speeding Chromium start up

If you have been using Chromium like me, you know it can get pretty slow on the first start up after a couple of months of usage.
It’s mainly because of all the SQLite 3.x databases it uses for history and other settings.
So here’s a simple script to defrag and reindex all the databases chromium uses.

1. Install SQLite3 :

# install sqlite3
emerge sqlite:3 #gentoo
aptitude install sqlite3 #ubuntu/debian based

2. Close Chromium.

3. Execute this in bash :

cd ~/.config/chromium/Default #where recent chromium store its settings

find -type f -exec file '{}' \; | perl -ne 'print "$1\n" if /(.*?): SQLite/' | while read fname; do 
    sqlite3 "${fname}" VACUUM; 
    sqlite3 "${fname}" REINDEX; 
done

VACUUM : The VACUUM command rebuilds the entire database.
REINDEX : The REINDEX command is used to delete and recreate indices from scratch.

4. Results (I ran this a couple of weeks ago so the result isn’t as good as it would be the first time. :

-rw-r--r-- 1 oneofone oneofone 37M Jan 14 17:27 History
-rw-r--r-- 1 oneofone oneofone 34M Jan 14 18:01 History
.................
-rw-r--r-- 1 oneofone oneofone 39K Nov 23 10:11 History Index 2010-08
-rw-r--r-- 1 oneofone oneofone 9.0K Jan 14 18:03 History Index 2010-08

-rw-r--r-- 1 oneofone oneofone 32M Jan  2 14:12 History Index 2010-09
-rw-r--r-- 1 oneofone oneofone 12M Jan 14 18:03 History Index 2010-09

-rw-r--r-- 1 oneofone oneofone 93M Jan 14 17:29 History Index 2010-10
-rw-r--r-- 1 oneofone oneofone 71M Jan 14 18:08 History Index 2010-10

-rw-r--r-- 1 oneofone oneofone 169M Jan 14 16:06 History Index 2010-11
-rw-r--r-- 1 oneofone oneofone 161M Jan 14 18:20 History Index 2010-11

-rw-r--r-- 1 oneofone oneofone 152M Jan 14 01:43 History Index 2010-12
-rw-r--r-- 1 oneofone oneofone 137M Jan 14 18:22 History Index 2010-12

-rw-r--r-- 1 oneofone oneofone 93M Jan 14 16:16 History Index 2011-01
-rw-r--r-- 1 oneofone oneofone 92M Jan 14 18:24 History Index 2011-01
.................
Tags: , , , , ,

4 Responses to “Speeding Chromium start up”

  1. Imbericle Says:

    Thank you very much.
    Seeing chromium starting for 20 seconds was awfully annoying.

  2. Imbericle Says:

    The effect of that procedure does get smaller each time. Meanwhile it doesn’t seem to have any effect on chromium 11 and 12 on Gentoo up to date.

    Do you have any further clues fixes?

  3. Imbericle Says:

    Is it also possible to read ahead the sql databases? If so,I could have done this by init eaven before X starts.

  4. OneOfOne Says:

    I haven’t tried it but in theory it should work.

Leave a Reply