Bug Description

Note: the follow up bug for this is bug #229745:

#229745 - after fix for #215728 - Committing to urlclassifier3. sqlite still causes excessive CPU usage and disk I/O (the 2nd)

===

Browsing with Firefox 3.0b5 on Hardy (All updates applied) causes Xorg to use 50-60% CPU all the time.

This is not limited to a particular site or page - it happens any time when Firefox is rendering pages.

The high CPU usage makes browsing very jerky - switching tabs takes more time than it should, pages appear frozen for a brief moment.

===

From https:/ /bugzilla. mozilla. org/show_ bug.cgi? id=430530# c4:

After some testing, it looks like this gets pretty bad on linux.

Once we hit sqlite's cache size, sqlite starts hitting the disk pretty hard.

While the database is small this isn't a big deal (we don't hit the cache

limit), and once we're up-to-date it isn't as bad (we aren't adding as much

data).

But during the middle/end of the push to get the complete database, things take

way too long, and we're thrashing the disk the whole time.

We can reduce the amount of IO by increasing the cache size, and that'll help

some (it'll help a whole lot if we increase the cache size by enough to hold

the db). We might also need to look at throttling the update process a bit, so

that we don't slam the system all at once...

===

To reproduce:

1. enable browser. safebrowsing. malware. enabled + browser. safebrowsing. enabled

2. observe IO on urlclassifier3. sqlite while browsing the web