diff options
author | cmumford <cmumford@chromium.org> | 2015-03-26 11:28:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-26 18:29:33 +0000 |
commit | 4050991eae26c33acb1c1996fe1900b43ae0fa13 (patch) | |
tree | 2318f6a135a046efcd83d80613ae4e986824dfb1 /components/leveldb_proto | |
parent | 695932863ee381ddcb55a61eae9e5f0623df9138 (diff) | |
download | chromium_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 'components/leveldb_proto')
-rw-r--r-- | components/leveldb_proto/DEPS | 2 | ||||
-rw-r--r-- | components/leveldb_proto/leveldb_database.cc | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/components/leveldb_proto/DEPS b/components/leveldb_proto/DEPS index 19109d2..743a2f3 100644 --- a/components/leveldb_proto/DEPS +++ b/components/leveldb_proto/DEPS @@ -1,3 +1,3 @@ include_rules = [ - "+third_party/leveldatabase/src/include", + "+third_party/leveldatabase", ] diff --git a/components/leveldb_proto/leveldb_database.cc b/components/leveldb_proto/leveldb_database.cc index 45f220e..b3e1a05 100644 --- a/components/leveldb_proto/leveldb_database.cc +++ b/components/leveldb_proto/leveldb_database.cc @@ -12,6 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/string_split.h" #include "base/threading/thread_checker.h" +#include "third_party/leveldatabase/env_chromium.h" #include "third_party/leveldatabase/src/include/leveldb/db.h" #include "third_party/leveldatabase/src/include/leveldb/iterator.h" #include "third_party/leveldatabase/src/include/leveldb/options.h" @@ -55,6 +56,7 @@ bool LevelDB::Init(const base::FilePath& database_dir) { leveldb::Options options; options.create_if_missing = true; options.max_open_files = 0; // Use minimum. + options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue; return InitWithOptions(database_dir, options); } |