Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: chrome/browser/history/thumbnail_database.cc

Issue 4106014: Tweaks to improve memory consumption by TopSites. The biggest culprit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/history/top_sites.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/thumbnail_database.cc
diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc
index e6158767ef89e4acc28077b593c18cdd1bbf8861..e1054ac6a173a89f423289daede27377e90259aa 100644
--- a/chrome/browser/history/thumbnail_database.cc
+++ b/chrome/browser/history/thumbnail_database.cc
@@ -104,21 +104,10 @@ sql::InitStatus ThumbnailDatabase::OpenDatabase(sql::Connection* db,
// Set the exceptional sqlite error handler.
db->set_error_delegate(GetErrorHandlerForThumbnailDb());
- // Set the database page size to something larger to give us
- // better performance (we're typically seek rather than bandwidth limited).
- // This only has an effect before any tables have been created, otherwise
- // this is a NOP. Must be a power of 2 and a max of 8192. We use a bigger
- // one because we're storing larger data (4-16K) in it, so we want a few
- // blocks per element.
- db->set_page_size(4096);
-
- // The UI is generally designed to work well when the thumbnail database is
- // slow, so we can tolerate much less caching. The file is also very large
- // and so caching won't save a significant percentage of it for us,
- // reducing the benefit of caching in the first place. With the default cache
- // size of 2000 pages, it will take >8MB of memory, so reducing it can be a
- // big savings.
- db->set_cache_size(64);
+ // Thumbnails db now only stores favicons, so we don't need that big a page
+ // size or cache.
+ db->set_page_size(2048);
+ db->set_cache_size(32);
// Run the database in exclusive mode. Nobody else should be accessing the
// database while we're running, and this will give somewhat improved perf.
« no previous file with comments | « no previous file | chrome/browser/history/top_sites.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698