Commit 7a9ec8c0 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Revert "Add memory metric to trace event to investigate omnibox performance"

This reverts commit e1b21dc7.

Reason for revert:
  1) No longer needed
  2) Slowing down omnibox

Original change's description:
> Add memory metric to trace event to investigate omnibox performance
>
> Adding estimated memory usage to the quick history provider.
> it is suspected to be slow and cause jank on UI thread when memory usage
> is high.
>
> These metrics will be received with slow-reports and will help to
> investigate some jank on UI thread.
>
> R=​mpearson@chromium.org
>
> Bug: 868419
> Change-Id: I344f84ec00f318fdb9db63c5b464b119a9d5e3eb
> Reviewed-on: https://chromium-review.googlesource.com/1156847
> Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
> Reviewed-by: Mark Pearson <mpearson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#579919}

TBR=mpearson@chromium.org,etienneb@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 868419
Change-Id: I96785874209368579844e9c55052bc53de12a5a8
Reviewed-on: https://chromium-review.googlesource.com/1174692Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582973}
parent 0ee31ecb
......@@ -45,13 +45,7 @@ HistoryQuickProvider::HistoryQuickProvider(AutocompleteProviderClient* client)
void HistoryQuickProvider::Start(const AutocompleteInput& input,
bool minimal_changes) {
// TODO(etienneb): Remove metrics when https://crbug/868419 is closed.
size_t memory_usage = 0;
if (in_memory_url_index_)
memory_usage = in_memory_url_index_->EstimateMemoryUsage();
TRACE_EVENT2("omnibox", "HistoryQuickProvider::Start",
"memory_url_index_.memory_usage", memory_usage, "text_length",
input.text().length());
TRACE_EVENT0("omnibox", "HistoryQuickProvider::Start");
matches_.clear();
if (disabled_ || input.from_omnibox_focus())
return;
......
......@@ -123,18 +123,6 @@ void InMemoryURLIndex::Init() {
PostRestoreFromCacheFileTask();
}
size_t InMemoryURLIndex::EstimateMemoryUsage() const {
size_t res = 0;
res += base::trace_event::EstimateMemoryUsage(scheme_whitelist_);
// TODO(dyaroshev): Add support for scoped_refptr in
// base::trace_event::EstimateMemoryUsage.
res += sizeof(URLIndexPrivateData) + private_data_->EstimateMemoryUsage();
return res;
}
void InMemoryURLIndex::ClearPrivateData() {
private_data_->Clear();
}
......@@ -227,7 +215,14 @@ void InMemoryURLIndex::OnHistoryServiceLoaded(
bool InMemoryURLIndex::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) {
size_t res = EstimateMemoryUsage();
size_t res = 0;
res += base::trace_event::EstimateMemoryUsage(scheme_whitelist_);
// TODO(dyaroshev): Add support for scoped_refptr in
// base::trace_event::EstimateMemoryUsage.
res += sizeof(URLIndexPrivateData) + private_data_->EstimateMemoryUsage();
const std::string dump_name =
base::StringPrintf("omnibox/in_memory_url_index/0x%" PRIXPTR,
reinterpret_cast<uintptr_t>(this));
......
......@@ -115,9 +115,6 @@ class InMemoryURLIndex : public KeyedService,
// history database.
void Init();
// Estimates the amount of memory used.
size_t EstimateMemoryUsage() const;
// Scans the history index and returns a vector with all scored, matching
// history items. This entry point simply forwards the call on to the
// URLIndexPrivateData class. For a complete description of this function
......
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