Performance improvement in UpdateComputedHypertext
AXPlatformNodeBase::UpdateComputedHypertext was using an expensive path to navigate unignored children. Replacing use of |ChildAtIndex| with |GetFirstChild| and |GetNextSibling| when iterating unignored children. Now instead of having to walk over all children up to the Nth unignored child for each iteration, it will find the first unignored child, then chain finding each unignored sibling. For the scenario I was measuring, this CL reduced the overall amount of time spent in AXTree::Unserialize by ~77%, and time spent in AXPlatformNodeBase::UpdateComputedHypertext by ~90%! I crafted a document where loading the document resulted in Unserialize having to process ~40k AXNodeData items in one AXTreeUpdate. I used "UI for ETW" to capture perf traces, and WPA to view the data. Before : * Weight in callstack of AXTree::Unserialize : 6424 * Weight in callstack of UpdateComputedHypertext : 5449 After : * Weight in callstack of AXTree::Unserialize : 1457 * Weight in callstack of UpdateComputedHypertext : 447 Bug: 1017829 Change-Id: I0edd29f4bba4811942a96c4f65fa96401dd10cea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879767Reviewed-by:Kurt Catti-Schmidt <kschmi@microsoft.com> Reviewed-by:
Nektarios Paisios <nektar@chromium.org> Commit-Queue: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#709956}
Showing
Please register or sign in to comment