New issue
Advanced search Search tips

Issue 727177 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

[MD Bookmarks] Improve performance before launch

Project Member Reported by tsergeant@chromium.org, May 29 2017

Issue description

MD Bookmarks is already pretty good performance-wise, but there's always more that can be done.

Important groundwork:

1. Add a timing metric to measure how long it takes to display the page

Then, low-hanging fruit for performance:

1. Vulcanize and CSS-build the page
2. Enable gzip for vulcanized resources
3. cr-lazy-render or dom-if out anything which doesn't need to be rendered at startup
4. Replace folder iron-icons with lightweight div+svg

Then, if we need it:

1. Add a basic shim for super fast rendering of the toolbar/background
2. Split out a 'lazy load' bundle to improve first-paint time
3. Automatically close deeply nested folders to reduce the amount of work to paint the folder tree 
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 30 2017

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

commit 9abc1e4d296152077d667de7864bc580eccb0638
Author: tsergeant <tsergeant@chromium.org>
Date: Tue May 30 00:40:37 2017

MD Bookmarks: Vulcanize page to reduce load time

This compiles the Bookmarks page in much the same way as the
History/Downloads/Settings pages. Testing locally, this appears to cut
about 25% off page load time (600ms to 450ms).

BUG= 727177 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

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

[modify] https://crrev.com/9abc1e4d296152077d667de7864bc580eccb0638/chrome/browser/BUILD.gn
[modify] https://crrev.com/9abc1e4d296152077d667de7864bc580eccb0638/chrome/browser/browser_resources.grd
[add] https://crrev.com/9abc1e4d296152077d667de7864bc580eccb0638/chrome/browser/resources/md_bookmarks/BUILD.gn
[modify] https://crrev.com/9abc1e4d296152077d667de7864bc580eccb0638/chrome/browser/resources/md_bookmarks/bookmarks.html
[modify] https://crrev.com/9abc1e4d296152077d667de7864bc580eccb0638/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 5 2017

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

commit 7167348fd337e7d77fa1dee2fdd55a4c4fe45725
Author: tsergeant <tsergeant@chromium.org>
Date: Mon Jun 05 00:24:29 2017

MD Bookmarks: Add a metric to measure load-time performance

This measures page load time in the metric 'Bookmarks.ResultsRenderedTime'.
Load time is measured after the page has been fully loaded and rendered.

BUG= 727177 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

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

[modify] https://crrev.com/7167348fd337e7d77fa1dee2fdd55a4c4fe45725/chrome/browser/resources/md_bookmarks/app.js
[modify] https://crrev.com/7167348fd337e7d77fa1dee2fdd55a4c4fe45725/extensions/common/api/_api_features.json

Status: Started (was: Assigned)
Supporting evidence for https://codereview.chromium.org/2946203002/:

These two screenshots show a trace of deleting 100 items, one without that patch applied and one with. The patch cuts down on all the time updating UI elements, and instead just runs the reducers in a tight loop.


delete_100_before.png
105 KB View Download
delete_100_after.png
92.6 KB View Download
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 22 2017

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

commit 9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73
Author: tsergeant <tsergeant@chromium.org>
Date: Thu Jun 22 03:22:27 2017

MD Bookmarks: Lazily render dropdown menus

This defers rendering the dropdown menus from the toolbar and command
manager until they are actually needed. This saves a small amount of time
(~10ms) during page load.

BUG= 727177 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

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

[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/browser/resources/md_bookmarks/command_manager.html
[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/browser/resources/md_bookmarks/command_manager.js
[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp
[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/browser/resources/md_bookmarks/toolbar.html
[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/browser/resources/md_bookmarks/toolbar.js
[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/test/data/webui/md_bookmarks/command_manager_test.js
[modify] https://crrev.com/9b9aa15f7c29fc3184868e63b1a9e6abb6d43d73/chrome/test/data/webui/md_bookmarks/toolbar_test.js

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 28 2017

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

commit f789a6236652537285fc13dac4cce609e1b94f55
Author: tsergeant <tsergeant@chromium.org>
Date: Wed Jun 28 01:15:19 2017

MD Bookmarks: Batch updates to the UI when processing API operations

In MD Bookmarks, each action processed from the bookmarks API listeners
would immediately notify the UI about changes that need to be made. In
cases where many notifications are triggered in a row (eg, deleting 100
bookmarks), this would cause many useless UI updates, slowing the page
down significantly.

This CL adds a 'batch mode' to the data store which suppresses UI
notifications while it is active. Enabling batch mode for API operations
(move, add, delete) makes these >10x faster with large numbers of nodes.

BUG= 727177 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

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

[modify] https://crrev.com/f789a6236652537285fc13dac4cce609e1b94f55/chrome/browser/resources/md_bookmarks/api_listener.js
[modify] https://crrev.com/f789a6236652537285fc13dac4cce609e1b94f55/chrome/browser/resources/md_bookmarks/store.js
[modify] https://crrev.com/f789a6236652537285fc13dac4cce609e1b94f55/chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js
[rename] https://crrev.com/f789a6236652537285fc13dac4cce609e1b94f55/chrome/test/data/webui/md_bookmarks/store_test.js

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 12 2017

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

commit 117c3d60ca9b1a84c4820f5701a17c2c49f681c2
Author: Tim Sergeant <tsergeant@chromium.org>
Date: Wed Jul 12 11:03:37 2017

MD Bookmarks: Lazily render sidebar tree descendants

This makes stamping folder trees with closed folders significantly
faster, without making any noticeable impact on fully-open trees.

Bug:  727177 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I087898598b265a396aeb6e178487ee8a5ece8d5a
Reviewed-on: https://chromium-review.googlesource.com/566205
Reviewed-by: Christopher Lam <calamity@chromium.org>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485921}
[modify] https://crrev.com/117c3d60ca9b1a84c4820f5701a17c2c49f681c2/chrome/browser/resources/md_bookmarks/folder_node.html

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 17 2017

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

commit c53fb60899fde8812967b52a2e97466cffe2fb2c
Author: Tim Sergeant <tsergeant@chromium.org>
Date: Mon Jul 17 05:50:19 2017

MD Bookmarks: Replace folder iron-icons with divs with an SVG background

MD Bookmarks stamps a large amount of the same folder icon: 1 for every
node in the sidebar, and 1 for every item in the list. While iron-icon
is fast as far as Polymer elements go, stamping 50+ of them is still
expensive.

This CL switches all folder icons across the page to a plain divs that
have an SVG background. This appears to save at least 5% of page load
time on profiles with a large number of folders.

Bug:  727177 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I439f83ad3c3f645108d1a3d744cce2e402acbcee
Reviewed-on: https://chromium-review.googlesource.com/566264
Reviewed-by: calamity <calamity@chromium.org>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487028}
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/browser_resources.grd
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/dnd_chip.html
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/dnd_chip.js
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/folder_node.html
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/folder_node.js
[delete] https://crrev.com/2d24b9cfb95b667ad13f7869593045166b295210/chrome/browser/resources/md_bookmarks/icons.html
[add] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/images/folder.svg
[add] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/images/folder_open.svg
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/item.html
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/item.js
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/resources/md_bookmarks/shared_style.html
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
[modify] https://crrev.com/c53fb60899fde8812967b52a2e97466cffe2fb2c/chrome/test/data/webui/md_bookmarks/item_test.js

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 2 2017

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

commit 94cae82296f36763d47b8b3a78ea30e977373501
Author: Christopher Lam <calamity@google.com>
Date: Wed Aug 02 01:48:29 2017

[MD Bookmarks] Hide folders below the second level by default.

This CL makes bookmark folders that are beneath the 2nd level of the
hierarchy get hidden by default. They will then retain the open state
after being explicitly opened or closed by the user.

Bug:  727177 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id53584e3c777a057e6a4f9536e0f1df01a242cd6
Reviewed-on: https://chromium-review.googlesource.com/583984
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491193}
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/app.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/constants.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/dnd_manager.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/folder_node.html
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/folder_node.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/reducers.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/store_client.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/types.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/browser/resources/md_bookmarks/util.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/app_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/command_manager_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/folder_node_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/item_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/list_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/policy_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/reducers_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/router_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/store_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/test_command_manager.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/test_util.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/toolbar_test.js
[modify] https://crrev.com/94cae82296f36763d47b8b3a78ea30e977373501/chrome/test/data/webui/md_bookmarks/util_test.js

Cc: -calamity@chromium.org
Owner: calamity@chromium.org
Status: Fixed (was: Started)
Marking fixed as the original bug points have been done. New performance bugs should get their own bugs.

Sign in to add a comment