Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Issue 2205083002: Optimize BlinkAXTreeSource by adding freeze/thaw for things like root, focus. (Closed)

Created:
4 years, 4 months ago by dmazzoni
Modified:
4 years, 3 months ago
Reviewers:
David Tseng
CC:
aboxhall+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, jam, je_julie, mlamouri+watch-content_chromium.org, nektar+watch_chromium.org, yuzo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Optimize BlinkAXTreeSource by adding freeze/thaw for things like root, focus. When profiling some sites that are slow to build an accessibility tree, a lot of time was spent retrieving the document, root accessibility object, or focused accessibility object. Introduce the concept of freezing BlinkAXTreeSource, which precomputes these once, and then allows them to be reused through the rest of a function scope. This is safe because the accessibility tree does not change during processing of an accessibility event. For one cs.chromium.org page, this sped up initial load by 50% (1000 ms to 650 ms) and single-node updates by 400% (90 ms to 23 ms). BUG=631923, 638474 Committed: https://crrev.com/36ef7b3f562ce421927e6abc941e716db2eb9dc6 Cr-Commit-Position: refs/heads/master@{#417073}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Rebase #

Patch Set 3 : Accessors for document, root, and focus #

Patch Set 4 : Fix pdf accessibility #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -28 lines) Patch
M content/renderer/accessibility/blink_ax_tree_source.h View 1 2 3 3 chunks +47 lines, -1 line 0 comments Download
M content/renderer/accessibility/blink_ax_tree_source.cc View 1 2 3 7 chunks +75 lines, -27 lines 0 comments Download
M content/renderer/accessibility/render_accessibility_impl.cc View 1 6 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (13 generated)
dmazzoni
4 years, 4 months ago (2016-08-04 02:51:07 UTC) #7
David Tseng
lgtm https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibility/blink_ax_tree_source.cc File content/renderer/accessibility/blink_ax_tree_source.cc (right): https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibility/blink_ax_tree_source.cc#newcode118 content/renderer/accessibility/blink_ax_tree_source.cc:118: } nit: indent https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibility/blink_ax_tree_source.cc#newcode155 content/renderer/accessibility/blink_ax_tree_source.cc:155: Could we move ...
4 years, 3 months ago (2016-09-07 18:59:27 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2205083002/40001
4 years, 3 months ago (2016-09-07 19:30:27 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/293660)
4 years, 3 months ago (2016-09-07 20:15:50 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2205083002/60001
4 years, 3 months ago (2016-09-07 20:53:48 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-09-07 22:05:20 UTC) #18
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/36ef7b3f562ce421927e6abc941e716db2eb9dc6 Cr-Commit-Position: refs/heads/master@{#417073}
4 years, 3 months ago (2016-09-07 22:07:43 UTC) #20
dmazzoni
4 years, 3 months ago (2016-09-08 05:26:43 UTC) #21
Message was sent while issue was closed.
https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibil...
File content/renderer/accessibility/blink_ax_tree_source.cc (right):

https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibil...
content/renderer/accessibility/blink_ax_tree_source.cc:118: }
On 2016/09/07 at 18:59:27, David Tseng wrote:
> nit: indent

I'm not 100% sure what indentation error you saw, but to be safe I just ran "git
cl format" and accepted all of its suggestions, so it should be fine now.

https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibil...
content/renderer/accessibility/blink_ax_tree_source.cc:155: 
On 2016/09/07 at 18:59:27, David Tseng wrote:
> Could we move this to the beginning of the function?

Sure, done.

https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibil...
File content/renderer/accessibility/blink_ax_tree_source.h (right):

https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibil...
content/renderer/accessibility/blink_ax_tree_source.h:88: int
accessibility_focus_id_;
On 2016/09/07 at 18:59:27, David Tseng wrote:
> Can you remove this now that you keep around |focus_|?

No, because on Android we still use accessibility focus,
and it might be different than focus.

https://codereview.chromium.org/2205083002/diff/1/content/renderer/accessibil...
content/renderer/accessibility/blink_ax_tree_source.h:94: blink::WebAXObject
focus_;
On 2016/09/07 at 18:59:27, David Tseng wrote:
> Suggestion: can we get a property accesser for this (similar to GetRoot) where
we CHECK(frozen) and use all three accessers in place of the private members?

Sure, good idea

Powered by Google App Engine
This is Rietveld 408576698