New issue
Advanced search Search tips

Issue 763519 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

TopSites is maintaining more top sites than needed

Project Member Reported by chengx@chromium.org, Sep 8 2017

Issue description

TopSites maintains a list of 20 top sites, excluding force sites and blacklist. However, only the top 8 are consumed. This results in a lot of unnecessary work of notifying its observers to do more work as well as maintaining the top sites both in memory and on disk.  


 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 12 2017

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

commit efddaef85901ddb8070f3b0c5207784c65943a1a
Author: Xi Cheng <chengx@chromium.org>
Date: Tue Sep 12 00:58:50 2017

Shorten the size of the maintained top site list from 20 to 10

Currently, TopSites maintains a list of 20 top sites excluding the blacklist. Whenever there is
a change in these 20 sites, TopSites updates its related database on disk via a task called
TopSitesBackend::UpdateTopSitesOnDBThread. The task takes more than 900 ms on average and has a
very high jank rate. These evidences show that it's the most expensive operation on the DB thread.
In addition to updating DB, TopSites also notifies its observers about the change so that work is
triggered in observer classes.

However, only the top 8 sites are used by the observers of TopSites. In more details, apart from
JumpList which uses the top 5 sites, all its observers use only the top 8 sites. These observers
include InstantService, MostVistedSites, SpotlightTopSitesBridge and GlobalMenuBarX11.

These facts indicate TopSites is maintaining more sites than needed. This CL changes TopSites to
maintain only 10 top sites to trim out that waste. We prefer 10 over 8 because in that way, there
is a bit of a buffer if the user blacklists a url and won't end up with an empty thumbnail.

Bug:  763103 ,  763519 
Change-Id: Ia0355cff95c8df23335c564a492a62e0011bc6f8
Reviewed-on: https://chromium-review.googlesource.com/656399
Commit-Queue: Xi Cheng <chengx@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501131}
[modify] https://crrev.com/efddaef85901ddb8070f3b0c5207784c65943a1a/components/history/core/browser/top_sites_impl.cc
[modify] https://crrev.com/efddaef85901ddb8070f3b0c5207784c65943a1a/components/history/core/browser/top_sites_impl.h
[modify] https://crrev.com/efddaef85901ddb8070f3b0c5207784c65943a1a/components/history/core/browser/top_sites_impl_unittest.cc

Comment 2 by chengx@chromium.org, Sep 12 2017

Status: Fixed (was: Assigned)

Comment 3 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 4 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment