summaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
authorrmcilroy@chromium.org <rmcilroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 22:20:34 +0000
committerrmcilroy@chromium.org <rmcilroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 22:20:34 +0000
commitaffa2da479667f6b86fd64221eae6a46b9a4307c (patch)
treecfdd80f5886bb6566f507263cd0eef522d7b772f /sql
parent205ba10cef5c5a0a0a199cdb6e889174c00068c3 (diff)
downloadchromium_src-affa2da479667f6b86fd64221eae6a46b9a4307c.zip
chromium_src-affa2da479667f6b86fd64221eae6a46b9a4307c.tar.gz
chromium_src-affa2da479667f6b86fd64221eae6a46b9a4307c.tar.bz2
Disable sqlite lookaside buffers by default.
Sqlite by default allocates 50KB per connection for use as a lookaside buffer for small object allocation. With the malloc implementations we use, this doesn't seem to help gain us any performance advantage, while increasing memory overhead, therefore this CL disables sqlite lookaside buffers by default. BUG=chromium:243769 TEST=Ran page_cycler perf test in Linux and Android and saw no noticable degradation. Examined traceview didn't see an increase in the time spent on the history or database threads. Review URL: https://chromiumcodereview.appspot.com/16356007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql')
-rw-r--r--sql/connection.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/connection.cc b/sql/connection.cc
index 09d8195..d27814d 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -631,6 +631,13 @@ bool Connection::OpenInternal(const std::string& file_name) {
return false;
}
+ // SQLite uses a lookaside buffer to improve performance of small mallocs.
+ // Chromium already depends on small mallocs being efficient, so we disable
+ // this to avoid the extra memory overhead.
+ // This must be called immediatly after opening the database before any SQL
+ // statements are run.
+ sqlite3_db_config(db_, SQLITE_DBCONFIG_LOOKASIDE, NULL, 0, 0);
+
// sqlite3_open() does not actually read the database file (unless a
// hot journal is found). Successfully executing this pragma on an
// existing database requires a valid header on page 1.