From 4050991eae26c33acb1c1996fe1900b43ae0fa13 Mon Sep 17 00:00:00 2001 From: cmumford Date: Thu, 26 Mar 2015 11:28:33 -0700 Subject: 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} --- storage/browser/fileapi/sandbox_directory_database.cc | 2 ++ storage/browser/fileapi/sandbox_origin_database.cc | 2 ++ 2 files changed, 4 insertions(+) (limited to 'storage') 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; -- cgit v1.1