summaryrefslogtreecommitdiffstats
path: root/google_apis
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 /google_apis
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 'google_apis')
-rw-r--r--google_apis/gcm/engine/gcm_store_impl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/google_apis/gcm/engine/gcm_store_impl.cc b/google_apis/gcm/engine/gcm_store_impl.cc
index 8f701a1..bc526c4 100644
--- a/google_apis/gcm/engine/gcm_store_impl.cc
+++ b/google_apis/gcm/engine/gcm_store_impl.cc
@@ -23,6 +23,7 @@
#include "google_apis/gcm/base/mcs_message.h"
#include "google_apis/gcm/base/mcs_util.h"
#include "google_apis/gcm/protocol/mcs.pb.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"
@@ -239,6 +240,7 @@ LoadStatus GCMStoreImpl::Backend::OpenStoreAndLoadData(LoadResult* result) {
leveldb::Options options;
options.create_if_missing = true;
+ options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue;
leveldb::DB* db;
leveldb::Status status =
leveldb::DB::Open(options, path_.AsUTF8Unsafe(), &db);