forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: Feature flag for in-memory temporary storage.
This CL introduces SqlTempStoreMemory flag, which is intended to be managed via Finch. When set, the flag causes sql::Database to run a PRAGMA temp_store=MEMORY [1] query on every opened database. This approach is intended to approximate the effect of building SQLite with the SQLITE_TEMP_STORE=3 [2] macro, to measure the memory consumption impact. Ideally, we'd test the macro directly, but //sql is a core component of Chrome, so we can't load different versions of it based on Finch. [1] https://www.sqlite.org/pragma.html#pragma_temp_store [2] https://www.sqlite.org/compile.html#temp_store Bug: 875538 Change-Id: I537d90d763be1100503ed4bd2ada2ee19eb090bb Reviewed-on: https://chromium-review.googlesource.com/1180530 Reviewed-by: Mark Pearson <mpearson@chromium.org> Reviewed-by: Chris Mumford <cmumford@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#584652}
- Loading branch information
Showing
6 changed files
with
103 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "sql/sql_features.h" | ||
|
||
namespace sql { | ||
|
||
namespace features { | ||
|
||
// SQLite databases only use RAM for temporary storage. | ||
// | ||
// Enabling this feature matches the SQLITE_TEMP_STORE=3 build option, which is | ||
// used on Android. | ||
// | ||
// TODO(pwnall): After the memory impact of the config change is assessed, land | ||
// https://crrev.com/c/1146493 and remove this flag. | ||
const base::Feature kSqlTempStoreMemory{"SqlTempStoreMemory", | ||
base::FEATURE_DISABLED_BY_DEFAULT}; | ||
|
||
} // namespace features | ||
|
||
} // namespace sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef SQL_SQL_FEATURES_H_ | ||
#define SQL_SQL_FEATURES_H_ | ||
|
||
#include "base/feature_list.h" | ||
#include "sql/sql_export.h" | ||
|
||
namespace sql { | ||
|
||
namespace features { | ||
|
||
SQL_EXPORT extern const base::Feature kSqlTempStoreMemory; | ||
|
||
} // namespace features | ||
|
||
} // namespace sql | ||
|
||
#endif // SQL_SQL_FEATURES_H_ |