New issue
Advanced search Search tips

Issue 804839 link

Starred by 0 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Clear Browsing Data dialog very slow

Project Member Reported by dullweber@chromium.org, Jan 23 2018

Issue description

Chrome Version: 63.0.3239.111
OS: Android

What steps will reproduce the problem?
(1) Have a Chrome instance with lots of data
(2) Open Clear Browsing Data

What is the expected result?
The dialog should appear instantly

What happens instead?
It takes some time until the dialog shows up.

 
Status: dul (was: Untriaged)
I noticed that on my personal device and account, CBD took about 3 seconds to load. I cleared Chrome and the issue was gone. 
After signin in and syncing again, I still get about 1-2s delay between clicking "Clear Browsing Data" and the dialog showing up. 

To debug the issue, I disabled counters but didn't notice any difference.
Then I disabled important sites and the delay is gone completely.

My guess is that FetchImportantSites slows down the dialog because it is called in ClearBrowsingDataPreference::onCreate. With the new UI, this is even called twice. We should make sure that Important Sites are only called once and that it is done after the dialog is initialized. 
Owner: dullweber@chromium.org
Status: Assigned (was: dul)
Maybe we could also add some performance logging or other ways to make it possible to debug such issues that only appear with large profiles in Chrome and don't appear in Chromium builds with fresh profiles. 
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 29 2018

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

commit 3b5fe53e0b6b49f5e270472792d67562d222926a
Author: Christian Dullweber <dullweber@chromium.org>
Date: Mon Jan 29 10:03:34 2018

Use shared state for ClearBrowsingDataPrefences

When the ClearBrowsingDataDialog is opened, a CBDPreferences is
created for each of the tabs. Each preference queries for information
about browsing history and fetches important sites. As these are
non-trivial operations, a class is introduced to only request both
infos once and share them between preferences.

Bug: 804839
Change-Id: I8495bc2e2ebeaeb8640d9d0775f701911d0045c8
Reviewed-on: https://chromium-review.googlesource.com/883783
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532377}
[add] https://crrev.com/3b5fe53e0b6b49f5e270472792d67562d222926a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataFetcher.java
[modify] https://crrev.com/3b5fe53e0b6b49f5e270472792d67562d222926a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
[modify] https://crrev.com/3b5fe53e0b6b49f5e270472792d67562d222926a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java
[modify] https://crrev.com/3b5fe53e0b6b49f5e270472792d67562d222926a/chrome/android/java_sources.gni
[modify] https://crrev.com/3b5fe53e0b6b49f5e270472792d67562d222926a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 29 2018

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

commit cf6a4b12dccad3e225001d3bbc21ddff00be67f2
Author: Christian Dullweber <dullweber@chromium.org>
Date: Mon Jan 29 12:36:04 2018

Add tracing for BrowsingDataCounter and ImportantSites

Add tracing for methods in BrowsingData[Counter]Bridge and each
browsing data counter. This will allow easier debugging of performance
issues with the Clear Browsing Data dialog.

Bug: 804839
Change-Id: I971d08edea77fee4e76e48b901516253e46fcb33
Reviewed-on: https://chromium-review.googlesource.com/883530
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532405}
[modify] https://crrev.com/cf6a4b12dccad3e225001d3bbc21ddff00be67f2/chrome/browser/android/browsing_data/browsing_data_bridge.cc
[modify] https://crrev.com/cf6a4b12dccad3e225001d3bbc21ddff00be67f2/chrome/browser/android/browsing_data/browsing_data_counter_bridge.cc
[modify] https://crrev.com/cf6a4b12dccad3e225001d3bbc21ddff00be67f2/components/browsing_data/core/counters/browsing_data_counter.cc

I had a noticable delay when opening Clear Browsing Data in my main Chrome instance again (contains lots of data).
The phone spends half a second just evaluating important sites. We could either do this as a task after the UI is loaded or even better take a look if some processing can be done on another thread?
Screenshot from 2018-07-30 15-43-57.png
23.8 KB View Download
The lines on the right are asynchronious Counter tasks
It seems to be possible to do cpu profiling for native code on Android. I will try to get a reproduction case in Chromium and try it out. Maybe there is an issue with important sites calculation that can be fixed.
https://www.chromium.org/developers/telemetry/profiling 

Sign in to add a comment