Commit f84ac87b authored by jamiewalch@google.com's avatar jamiewalch@google.com

Reverting based on discussions on #chromium with shess and rsleevi

Revert 111386 - Add a field trial for using lower sqlite cache sizes.



There are a few relevant histograms that I annotated with the field trial name, and I added a new AddPage histogram.



TEST=none

BUG=none
Review URL: http://codereview.chromium.org/8379009

TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/8677025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111433 0039d316-1c4b-4281-b951-d872f2087c98
parent 8de36ee3
......@@ -16,7 +16,6 @@
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_database.h"
#include "chrome/browser/history/history_field_trial.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
......@@ -352,8 +351,7 @@ void HistoryURLProvider::ExecuteWithDB(history::HistoryBackend* backend,
DoAutocomplete(backend, db, params);
UMA_HISTOGRAM_TIMES("Autocomplete.HistoryAsyncQueryTime" +
history::HistoryFieldTrial::GetGroupSuffix(),
UMA_HISTOGRAM_TIMES("Autocomplete.HistoryAsyncQueryTime",
base::TimeTicks::Now() - beginning_time);
}
......
......@@ -19,7 +19,6 @@
#include "base/time.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/bookmarks/bookmark_service.h"
#include "chrome/browser/history/history_field_trial.h"
#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/history/history_publisher.h"
#include "chrome/browser/history/in_memory_history_backend.h"
......@@ -374,8 +373,6 @@ void HistoryBackend::AddPage(scoped_refptr<HistoryAddPageArgs> request) {
if (!db_.get())
return;
TimeTicks beginning_time = TimeTicks::Now();
// Will be filled with the URL ID and the visit ID of the last addition.
std::pair<URLID, VisitID> last_ids(0, tracker_.GetLastVisit(
request->id_scope, request->page_id, request->referrer));
......@@ -547,10 +544,6 @@ void HistoryBackend::AddPage(scoped_refptr<HistoryAddPageArgs> request) {
}
ScheduleCommit();
UMA_HISTOGRAM_TIMES(
"History.AddPage" + HistoryFieldTrial::GetGroupSuffix(),
TimeTicks::Now() - beginning_time);
}
void HistoryBackend::InitImpl(const std::string& languages) {
......@@ -560,8 +553,6 @@ void HistoryBackend::InitImpl(const std::string& languages) {
// we only set db_ to the created database if creation is successful. That
// way other methods won't do anything as db_ is still NULL.
HistoryFieldTrial::Activate();
TimeTicks beginning_time = TimeTicks::Now();
// Compute the file names. Note that the index file can be removed when the
......@@ -1232,9 +1223,8 @@ void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request,
request->ForwardResult(request->handle(), &request->value);
UMA_HISTOGRAM_TIMES(
"History.QueryHistory" + HistoryFieldTrial::GetGroupSuffix(),
TimeTicks::Now() - beginning_time);
UMA_HISTOGRAM_TIMES("History.QueryHistory",
TimeTicks::Now() - beginning_time);
}
// Basic time-based querying of history.
......
......@@ -14,7 +14,6 @@
#include "base/rand_util.h"
#include "base/string_util.h"
#include "chrome/browser/diagnostics/sqlite_diagnostics.h"
#include "chrome/browser/history/history_field_trial.h"
#include "chrome/browser/history/starred_url_database.h"
#include "sql/transaction.h"
......@@ -80,15 +79,11 @@ sql::InitStatus HistoryDatabase::Init(const FilePath& history_name,
// this is a NOP. Must be a power of 2 and a max of 8192.
db_.set_page_size(4096);
if (HistoryFieldTrial::IsLowMemFieldTrial()) {
db_.set_cache_size(500);
} else {
// Increase the cache size. The page size, plus a little extra, times this
// value, tells us how much memory the cache will use maximum.
// 6000 * 4MB = 24MB
// TODO(brettw) scale this value to the amount of available memory.
db_.set_cache_size(6000);
}
// Increase the cache size. The page size, plus a little extra, times this
// value, tells us how much memory the cache will use maximum.
// 6000 * 4MB = 24MB
// TODO(brettw) scale this value to the amount of available memory.
db_.set_cache_size(6000);
// Note that we don't set exclusive locking here. That's done by
// BeginExclusiveMode below which is called later (we have to be in shared
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/history/history_field_trial.h"
#include "base/metrics/field_trial.h"
namespace history {
namespace {
int g_low_mem_trial_group = 0;
bool g_low_mem_trial = false;
static const char kHistoryFieldTrialName[] = "History";
} // namespace
// static
void HistoryFieldTrial::Activate() {
if (g_low_mem_trial_group)
return; // Already initialized.
scoped_refptr<base::FieldTrial> trial(new base::FieldTrial(
kHistoryFieldTrialName, 1000, "Inactive", 2012, 2, 1));
g_low_mem_trial_group = trial->AppendGroup("LowMem", 50); // 5%
if (trial->group() == g_low_mem_trial_group)
g_low_mem_trial = true;
}
// static
bool HistoryFieldTrial::IsLowMemFieldTrial() {
return g_low_mem_trial;
}
// static
std::string HistoryFieldTrial::GetGroupSuffix() {
return g_low_mem_trial ? std::string("_LowMem") : std::string();
}
} // namespace history
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_HISTORY_HISTORY_FIELD_TRIAL_H_
#define CHROME_BROWSER_HISTORY_HISTORY_FIELD_TRIAL_H_
#pragma once
#include <string>
namespace history {
class HistoryFieldTrial {
public:
static void Activate();
// Returns true if history should try to use less memory.
static bool IsLowMemFieldTrial();
// Returns the group name as a suffix to append to histogram names for the
// current field trial, or the empty string if none.
static std::string GetGroupSuffix();
};
} // namespace history
#endif // CHROME_BROWSER_HISTORY_HISTORY_FIELD_TRIAL_H_
......@@ -10,7 +10,6 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/history/history_field_trial.h"
namespace history {
......@@ -92,9 +91,8 @@ bool InMemoryDatabase::InitFromDisk(const FilePath& history_name) {
// just not exist yet.
}
base::TimeTicks end_load = base::TimeTicks::Now();
UMA_HISTOGRAM_MEDIUM_TIMES(
"History.InMemoryDBPopulate" + HistoryFieldTrial::GetGroupSuffix(),
end_load - begin_load);
UMA_HISTOGRAM_MEDIUM_TIMES("History.InMemoryDBPopulate",
end_load - begin_load);
UMA_HISTOGRAM_COUNTS("History.InMemoryDBItemCount", db_.GetLastChangeCount());
{
......
......@@ -15,7 +15,6 @@
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/diagnostics/sqlite_diagnostics.h"
#include "chrome/browser/history/history_field_trial.h"
#include "sql/statement.h"
#include "sql/transaction.h"
......@@ -139,13 +138,7 @@ bool TextDatabase::Init() {
// have 2-3 of these objects, each with their own 8MB, this adds up very fast.
// We therefore reduce the size so when there are multiple objects, we're not
// too big.
if (HistoryFieldTrial::IsLowMemFieldTrial()) {
// FTS does merges of 16 pages at a time, so we need a working set size
// somewhat greater than that to prevent too much thrashing.
db_.set_cache_size(128);
} else {
db_.set_cache_size(512);
}
db_.set_cache_size(512);
// Run the database in exclusive mode. Nobody else should be accessing the
// database while we're running, and this will give somewhat improved perf.
......
......@@ -1323,8 +1323,6 @@
'browser/history/history_database.h',
'browser/history/history_extension_api.cc',
'browser/history/history_extension_api.h',
'browser/history/history_field_trial.cc',
'browser/history/history_field_trial.h',
'browser/history/history_marshaling.h',
'browser/history/history_notifications.cc',
'browser/history/history_notifications.h',
......
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