summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorcmumford <cmumford@chromium.org>2015-03-26 11:28:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-26 18:29:33 +0000
commit4050991eae26c33acb1c1996fe1900b43ae0fa13 (patch)
tree2318f6a135a046efcd83d80613ae4e986824dfb1 /storage
parent695932863ee381ddcb55a61eae9e5f0623df9138 (diff)
downloadchromium_src-4050991eae26c33acb1c1996fe1900b43ae0fa13.zip
chromium_src-4050991eae26c33acb1c1996fe1900b43ae0fa13.tar.gz
chromium_src-4050991eae26c33acb1c1996fe1900b43ae0fa13.tar.bz2
leveldb: Reuse manifest (AKA logs) during open.
All leveldb uses now set the reuse_logs option to trigger a new fast open path. For db's with prior changes (i.e. non-empty logs) this avoids three fsync calls (on average) for every open as well as the need to compact (rewrite) the db. More info at: https://github.com/google/leveldb/commit/251ebf5dc70129ad3c38193fe6c99a5b0ec6b9fa BUG=468810 Review URL: https://codereview.chromium.org/1025433003 Cr-Commit-Position: refs/heads/master@{#322433}
Diffstat (limited to 'storage')
-rw-r--r--storage/browser/fileapi/sandbox_directory_database.cc2
-rw-r--r--storage/browser/fileapi/sandbox_origin_database.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/storage/browser/fileapi/sandbox_directory_database.cc b/storage/browser/fileapi/sandbox_directory_database.cc
index 8343fea..976a3fa 100644
--- a/storage/browser/fileapi/sandbox_directory_database.cc
+++ b/storage/browser/fileapi/sandbox_directory_database.cc
@@ -18,6 +18,7 @@
#include "base/strings/string_util.h"
#include "storage/browser/fileapi/file_system_usage_cache.h"
#include "storage/common/fileapi/file_system_util.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
@@ -727,6 +728,7 @@ bool SandboxDirectoryDatabase::Init(RecoveryOption recovery_option) {
leveldb::Options options;
options.max_open_files = 0; // Use minimum.
options.create_if_missing = true;
+ options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue;
if (env_override_)
options.env = env_override_;
leveldb::DB* db;
diff --git a/storage/browser/fileapi/sandbox_origin_database.cc b/storage/browser/fileapi/sandbox_origin_database.cc
index fa0521f..1f149e3 100644
--- a/storage/browser/fileapi/sandbox_origin_database.cc
+++ b/storage/browser/fileapi/sandbox_origin_database.cc
@@ -17,6 +17,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "storage/common/fileapi/file_system_util.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
@@ -80,6 +81,7 @@ bool SandboxOriginDatabase::Init(InitOption init_option,
leveldb::Options options;
options.max_open_files = 0; // Use minimum.
options.create_if_missing = true;
+ options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue;
if (env_override_)
options.env = env_override_;
leveldb::DB* db;