New issue
Advanced search Search tips

Issue 708793 link

Starred by 0 users

Issue metadata

Status: Untriaged
Owner: ----
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ProfileStatisticsAggregator::CountPrefs does too much work and uses too much memory

Project Member Reported by brettw@chromium.org, Apr 5 2017

Issue description

This function calls PrefService::GetPreferenceValuesWithoutPathExpansion() which I think is only used by this function. GetPreferenceValuesWithoutPathExpansion creates a large map of all preferences with the keys flattened and does a deep copy of all default values.

This list is then iterated over, and the preferences service is re-queried for each one. The non-default user-prefs are counted and logged.

This happens whenever the last browser window for a profile is closed and if the browser didn't exit cleanly, on startup.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0

commit ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0
Author: brettw <brettw@chromium.org>
Date: Tue Apr 18 21:10:53 2017

Improve profile stats performace.

Collecting stats on prefs can take a lot of allocations and times to copy the whole preferences tree.

Adds an iterator-with-callback API to read the preferences without copying. This is now used in prefs stats. The other two similar APIs in the preferences service have been coalesced with a flag controlling whether you want default prefs.

BUG=708793

Review-Url: https://codereview.chromium.org/2799143002
Cr-Commit-Position: refs/heads/master@{#465374}

[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/chromeos/preferences_chromeos_browsertest.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/prefs/pref_functional_browsertest.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/profiles/profile_statistics_aggregator.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/profiles/profile_statistics_aggregator.h
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/ui/webui/local_state/local_state_ui.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/chrome/browser/ui/webui/prefs_internals_source.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/components/prefs/pref_service.cc
[modify] https://crrev.com/ebf7184f6f68e5b60a5247b65bb008a7b3ca1fb0/components/prefs/pref_service.h

Comment 2 by brettw@chromium.org, Mar 20 2018

Owner: ----
Status: Available (was: Assigned)
Status: Untriaged (was: Available)
Available, but no owner or component? Please find a component, as no one will ever find this without one.

Sign in to add a comment