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

Unified Diff: sql/connection.h

Issue 16356007: Disable sqlite lookaside buffers by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | sql/connection.cc » ('j') | sql/connection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index 049d7cf5b4e2f9715ffc4b7f67dd2e89dc367bff..21b3e13bbf58aa92c0e5369f3af9cb4b5aed425c 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -140,6 +140,16 @@ class SQL_EXPORT Connection {
// This must be called before Open() to have an effect.
void set_exclusive_locking() { exclusive_locking_ = true; }
+
+ // Call to have the database use the default lookaside buffer for small object
+ // allocations. The lookaside buffer is intended to provide a speed boost when
+ // running with slow malloc implementations. However, under typical use-cases
+ // in Chrome, it seem to have no negligible impact while costing 50KB per
+ // connection, therefore we disable it by default.
+ //
+ // This must be called before Open() to have an effect.
+ void set_enable_lookaside_buffer() { enable_lookaside_buffer_ = true; }
+
Scott Hess - ex-Googler 2013/06/04 16:35:21 IMHO, this is either the right thing to do, or not
rmcilroy 2013/06/04 17:05:38 Done.
// Set an error-handling callback. On errors, the error number (and
// statement, if available) will be passed to the callback.
//
@@ -496,6 +506,7 @@ class SQL_EXPORT Connection {
int page_size_;
int cache_size_;
bool exclusive_locking_;
+ bool enable_lookaside_buffer_;
// All cached statements. Keeping a reference to these statements means that
// they'll remain active.
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698