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

Unified Diff: sql/connection.cc

Issue 16356007: Disable sqlite lookaside buffers by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to disabling in sql/connection.cc Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index 09d8195df502d440430f8124538733d8a4c776e9..d27814daeeaa49f24db586f4fc9022147a6d302a 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698