New issue
Advanced search Search tips

Issue 853824 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocking:
issue 836905



Sign in to add a comment

Do perf analysis of PaintTouchActionRects

Project Member Reported by pdr@chromium.org, Jun 18 2018

Issue description

PaintTouchActionRects is a new mode where touch action rects are painted. It replaces the main scrolling coordinator update. We need to do some early perf analysis by running this mode through the perf bots.
 

Comment 3 by pdr@chromium.org, Jun 18 2018

I did a local test of performance and PaintTouchActionRects looks pretty good on a pathalogical touch action rect testcase. PaintTouchActionRects has better caching because it re-uses paint's caching, and even seems to be a little faster for the initial rect calculation too.

current load:
  updateAllLifecyclePhases: 406.3
  prepaint: 226.6
  scrollingcoordinator: 55.9
  paint: 8.83

current append:
  updateAllLifecyclePhases: 76.7
  prepaint: 11.7
  scrollingcoordinator: 58.5
  paint: 6.3

paint touch action rects load:
  updateAllLifecyclePhases: 362.4
  prepaint: 242.2
  scrollingcoordinator: 0.2
  paint: 7.9

paint touch action rects append:
  updateAllLifecyclePhases: 18.6
  prepaint: 11.7
  scrollingcoordinator: 0.28
  paint: 6.5
touchactionperf.html
2.3 KB View Download
Project Member

Comment 4 by 42576172...@developer.gserviceaccount.com, Jun 18 2018

📍 Job complete. See results below.
https://pinpoint-dot-chromeperf.appspot.com/job/119ee7a3240000
Project Member

Comment 5 by 42576172...@developer.gserviceaccount.com, Jun 18 2018

📍 Job complete. See results below.
https://pinpoint-dot-chromeperf.appspot.com/job/15c18add240000
Project Member

Comment 7 by 42576172...@developer.gserviceaccount.com, Jun 19 2018

📍 Job complete. See results below.
https://pinpoint-dot-chromeperf.appspot.com/job/119dfd3d240000
Labels: Performance
We should use the benchmark in https://bugs.chromium.org/p/chromium/issues/detail?id=854451#c16 and see how PaintTouchActionRects compares.
Owner: xidac...@chromium.org
Xida, are you looking into 854451? If so, can you see how it performs with --enable-blink-features=PaintTouchActionRects ?
uploaded two trace for  crbug.com/854451 , one with PTAR enabled and one without.

Without PTAR, the touch action rects are calculated in ScrollingCoordinator::updateTouchEventTargetRectsIfNeeded, we can see that at it took about 290ms towards the end of the timeline.

With PTAR, the calculation has two parts, RecordHitTestData and updateTouchEventTargetRectsIfNeeded. From the trace the average cost is 14.48ms. That is 20x performance improvement.
trace_854451-non-PTAR.json.gz
7.7 MB Download
trace_854451-PTAR.json.gz
7.7 MB Download
Cc: pdr@chromium.org
It looks like the paint time regressed from ~21ms to ~8ms, though some of this is trace overhead due to tracing the hit test rect paint. The scrolling coordinator update is much faster with PaintTouchActionRects. Overall, the begin main frame time progressed from to ~92ms to ~27ms. I think we're looking pretty good and can experiment with enabling this by default.
Doing the same analysis for  crbug.com/800522 

Without PTAR, ScrollingCoordinator::updateTouchEventTargetRectsIfNeeded takes average of 4114ms.

With PTAR, RecordHitTestData + updateTouchEventTargetRectsIfNeeded takes average of 31.69ms

That is 130x performance improvement.
trace_800522-non-PTAR.json.gz
4.1 MB Download
trace_800522-PTAR.json.gz
3.7 MB Download
Fantastic! In these traces I see the same progression in BeginMainFrame times: from ~160ms to ~10ms.
Now for  crbug.com/718271 

Without PTAR, ScrollingCoordinator::updateTouchEventTargetRectsIfNeeded takes average of 0.469ms

With PTAR, RecordHitTestData + updateTouchEventTargetRectsIfNeeded takes average of 0.0967, that is 5x performance boost.
trace_718271-non-PTAR.json.gz
3.3 MB Download
trace_718271-PTAR.json.gz
3.1 MB Download
Status: Fixed (was: Assigned)
With PTAR enabled by default, closing this bug.
📍 Job complete. See results below.
https://pinpoint-dot-chromeperf.appspot.com/job/10d4e6b8e40000
Project Member

Comment 19 by bugdroid1@chromium.org, Sep 24

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

commit 99774c50cd7c63b45b8c3d6abb750f4b8a33a7b0
Author: Philip Rogers <pdr@chromium.org>
Date: Mon Sep 24 20:25:05 2018

[PaintTouchActionRects] Remove unused HitTestData border_rect member

Bug:  853824 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6e52260c7966a59434176c20867a11b5505a1cde
Reviewed-on: https://chromium-review.googlesource.com/1240740
Reviewed-by: Xida Chen <xidachen@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593661}
[modify] https://crrev.com/99774c50cd7c63b45b8c3d6abb750f4b8a33a7b0/third_party/blink/renderer/platform/graphics/paint/hit_test_data.h
[modify] https://crrev.com/99774c50cd7c63b45b8c3d6abb750f4b8a33a7b0/third_party/blink/renderer/platform/graphics/paint/paint_chunk.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Sep 25

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

commit 33ef01daec9bbe83e58eba198ae8699486e70ecd
Author: Philip Rogers <pdr@chromium.org>
Date: Tue Sep 25 14:03:17 2018

[PaintTouchActionRects] Use cached display items

Touch action rects should use the PaintController's caching mechanisms to
avoid performance differences with regular background painting. This patch adds
a test, TouchActionRectPaintCaching, to verify this new behavior. A second test,
TouchActionRectPaintChunkChanges, has been added that verifies that PaintChunk
rects are cleared between paints and do not incorrectly accumulate forever on
the chunks.

Bug:  853824 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ic2d6aec67ad2b65525475bec4ecb7ad1a28c0278
Reviewed-on: https://chromium-review.googlesource.com/1240873
Reviewed-by: Xida Chen <xidachen@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593916}
[modify] https://crrev.com/33ef01daec9bbe83e58eba198ae8699486e70ecd/third_party/blink/renderer/core/paint/block_painter_test.cc
[modify] https://crrev.com/33ef01daec9bbe83e58eba198ae8699486e70ecd/third_party/blink/renderer/platform/graphics/paint/hit_test_data.cc

Status: Assigned (was: Fixed)
Re-open because we revert the ship of PaintTouchActionRects.
Cc: -pdr@chromium.org sunxd@chromium.org xidac...@chromium.org
Owner: pdr@chromium.org
Status: Fixed (was: Assigned)
We're relanding the enabling of PaintTouchActionRects with all known perf issues and correctness issues addressed.

Sign in to add a comment