From affa2da479667f6b86fd64221eae6a46b9a4307c Mon Sep 17 00:00:00 2001 From: "rmcilroy@chromium.org" Date: Thu, 6 Jun 2013 22:20:34 +0000 Subject: 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 --- sql/connection.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql') 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. -- cgit v1.1