Commit b7c1cc05 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Remove switches for ModelTypeStoreBackend performance tweaks

These features are enabled by default with M71 and seem effective
according to experiments on canary&dev, so there's no need to keep these
feature toggles around.

These features may also be the cause for certain unrelated test
flakiness on TSAN, presumably because test-only feature overrides are
not thread safe.

Bug: 887068,892550
Change-Id: Ia57e1f161f726db05e2322568da51d3681df8751
Reviewed-on: https://chromium-review.googlesource.com/c/1296504Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602265}
parent 83dbce6b
......@@ -6,7 +6,6 @@
#include <utility>
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "components/sync/protocol/model_type_store_schema_descriptor.pb.h"
......@@ -30,11 +29,6 @@ const char ModelTypeStoreBackend::kDBSchemaDescriptorRecordId[] =
const char ModelTypeStoreBackend::kStoreInitResultHistogramName[] =
"Sync.ModelTypeStoreInitResult";
const base::Feature kModelTypeStoreAvoidReadCache{
"kModelTypeStoreAvoidReadCache", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kModelTypeStoreSmallWriteBufferSize{
"kModelTypeStoreSmallWriteBufferSize", base::FEATURE_ENABLED_BY_DEFAULT};
namespace {
StoreInitResultForHistogram LevelDbStatusToStoreInitResult(
......@@ -138,8 +132,6 @@ leveldb::Status ModelTypeStoreBackend::OpenDatabase(const std::string& path,
leveldb_env::Options options;
options.create_if_missing = true;
options.paranoid_checks = true;
if (base::FeatureList::IsEnabled(kModelTypeStoreSmallWriteBufferSize))
options.write_buffer_size = 512 * 1024;
if (env)
......@@ -166,7 +158,6 @@ base::Optional<ModelError> ModelTypeStoreBackend::ReadRecordsWithPrefix(
record_list->reserve(id_list.size());
leveldb::ReadOptions read_options;
read_options.verify_checksums = true;
if (base::FeatureList::IsEnabled(kModelTypeStoreAvoidReadCache))
read_options.fill_cache = false;
std::string key;
std::string value;
......@@ -191,7 +182,6 @@ base::Optional<ModelError> ModelTypeStoreBackend::ReadAllRecordsWithPrefix(
DCHECK(db_);
leveldb::ReadOptions read_options;
read_options.verify_checksums = true;
if (base::FeatureList::IsEnabled(kModelTypeStoreAvoidReadCache))
read_options.fill_cache = false;
std::unique_ptr<leveldb::Iterator> iter(db_->NewIterator(read_options));
const leveldb::Slice prefix_slice(prefix);
......@@ -225,7 +215,6 @@ ModelTypeStoreBackend::DeleteDataAndMetadataForPrefix(
DCHECK(db_);
leveldb::WriteBatch write_batch;
leveldb::ReadOptions read_options;
if (base::FeatureList::IsEnabled(kModelTypeStoreAvoidReadCache))
read_options.fill_cache = false;
std::unique_ptr<leveldb::Iterator> iter(db_->NewIterator(read_options));
const leveldb::Slice prefix_slice(prefix);
......@@ -255,7 +244,6 @@ int64_t ModelTypeStoreBackend::GetStoreVersion() {
DCHECK(db_);
leveldb::ReadOptions read_options;
read_options.verify_checksums = true;
if (base::FeatureList::IsEnabled(kModelTypeStoreAvoidReadCache))
read_options.fill_cache = false;
std::string value;
ModelTypeStoreSchemaDescriptor schema_descriptor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment