New issue
Advanced search Search tips

Issue 770343 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task


Sign in to add a comment

[root layer scrolls] check for performance regressions

Project Member Reported by skobes@chromium.org, Sep 29 2017

Issue description

Master bug for investigations into possible performance regressions from root layer scrolling.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 19 2017

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

commit 64dacecf302750183e254d92cb5e459c553d9f62
Author: Stefan Zager <szager@chromium.org>
Date: Tue Dec 19 01:21:31 2017

[RootLayerScrolls] Dispatch fake mouse events without quad

This is a small optimization -- profiling shows that
DispatchFakeMouseEventSoon is faster than
DispatchFakeMouseEventSoonInQuad.  The only purpose of the quad is
to ensure that the last known mouse position was inside the
scrollable area before issuing the fake mouse move event.  For the
root layer, that will always be true.

Bug:  770343 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I56279676138dda97eff3f6b89140f0ff9cc676ab
Reviewed-on: https://chromium-review.googlesource.com/831487
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524894}
[modify] https://crrev.com/64dacecf302750183e254d92cb5e459c553d9f62/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
[modify] https://crrev.com/64dacecf302750183e254d92cb5e459c553d9f62/third_party/WebKit/Source/core/layout/LayoutBox.cpp
[modify] https://crrev.com/64dacecf302750183e254d92cb5e459c553d9f62/third_party/WebKit/Source/core/layout/LayoutBox.h
[modify] https://crrev.com/64dacecf302750183e254d92cb5e459c553d9f62/third_party/WebKit/Source/core/layout/LayoutView.cpp
[modify] https://crrev.com/64dacecf302750183e254d92cb5e459c553d9f62/third_party/WebKit/Source/core/layout/LayoutView.h
[modify] https://crrev.com/64dacecf302750183e254d92cb5e459c553d9f62/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Project Member

Comment 2 by bugdroid1@chromium.org, Dec 19 2017

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

commit 942302a65c802dd5e9365e9d530a8a379065be5b
Author: Stefan Zager <szager@chromium.org>
Date: Tue Dec 19 06:49:55 2017

Skip redundant visible size computation for root scroller.

Bug:  770343 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ib6b21d41f1d313b8d41c077fd2372ca9f1a81ce4
Reviewed-on: https://chromium-review.googlesource.com/831489
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524957}
[modify] https://crrev.com/942302a65c802dd5e9365e9d530a8a379065be5b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Project Member

Comment 3 by bugdroid1@chromium.org, Jan 9 2018

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

commit 511f53a7a500a947880b2781dbbeb4b78ece571f
Author: Stefan Zager <szager@chromium.org>
Date: Tue Jan 09 20:45:38 2018

Don't include root layer scroll offset in PaintLayer positions.

This is a performance optimization for root layer scrolling, to avoid
a full layer tree walk to update layer positions on every frame
scroll.

BUG= 770343 

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I49ac93b3ccdc9abe042e1521cfcd0190c87ad78b
Reviewed-on: https://chromium-review.googlesource.com/854628
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528095}
[modify] https://crrev.com/511f53a7a500a947880b2781dbbeb4b78ece571f/third_party/WebKit/Source/core/paint/PaintLayer.cpp
[modify] https://crrev.com/511f53a7a500a947880b2781dbbeb4b78ece571f/third_party/WebKit/Source/core/paint/PaintLayer.h

Comment 4 by skobes@chromium.org, Jan 30 2018

Status: Fixed (was: Available)
Blockedon: 811458
Owner: chrishtr@chromium.org
Status: Assigned (was: Fixed)
In part because of 
I observed that one remaining performance difference between RLS and not-RLS
is that a compositing update of type kCompositingUpdateAfterGeometryChange happens
upon scroll. This is a lot of extra work if there are a number of layers.

Earlier work got rid of the need to update the clip rects cache and layer positions;
now we need to make the composited layer positions scroll-independent. This shouldn't
be too hard, because it's always the case that the LayoutView's scroll and the offsets
of sub-layers compensate for each other, except in the case of fixed-position layers,
which are handled with extra code already.
Blockedon: 811427 811429
I observed that scrolling of the root layer still causes a compositing
update of type kCompositingUpdateAfterGeometryChange. This is bad because
it is work proportional to the # of composited layers.

This work can be avoided by not including scroll offset of the root layer
and its children in the calculations. These offsets cancel each out anyway, so are unnecessary.

Comment 9 by skobes@chromium.org, Feb 13 2018

I looked into the compositing update issue for a bit on https://bugs.chromium.org/p/chromium/issues/detail?id=504057#c5 and decided it didn't look too bad, but if traces point to it as a hot path then we should definitely reopen.
Blockedon: 811601 811457 811430 811574 811438 811439
Project Member

Comment 11 by bugdroid1@chromium.org, Feb 16 2018

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

commit 32419f4422bf130d9c52331a0c7dafba9337cc99
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Fri Feb 16 02:50:27 2018

[RLS] Skip compositing input step if a scroll can be applied directly.

This re-introduces the fast path implemented in PLC::FrameViewDidScroll.

Test coverage: all layout tests which use main-thread scrolling of a
composited layer (e.g. using window.scrollBy or gestures on scrollbars).

Bug:  770343 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I93a43072d19871611fa8845758410b094d67a8f7
Reviewed-on: https://chromium-review.googlesource.com/923089
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537143}
[modify] https://crrev.com/32419f4422bf130d9c52331a0c7dafba9337cc99/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Comment 12 Deleted

Blockedon: 813884
Project Member

Comment 14 by bugdroid1@chromium.org, Feb 21 2018

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

commit e0c819ef2ef21b3580dbf5458cc3f966c2dbc9e1
Author: Stephen Chenney <schenney@chromium.org>
Date: Wed Feb 21 17:45:02 2018

Revert "[RLS] Skip compositing input step if a scroll can be applied directly."

This reverts commit 32419f4422bf130d9c52331a0c7dafba9337cc99.

Reason for revert: Huge perf regression on mobile, and impact on checkerboarding metrics.

https://bugs.chromium.org/p/chromium/issues/detail?id=813884
https://bugs.chromium.org/p/chromium/issues/detail?id=813875

Original change's description:
> [RLS] Skip compositing input step if a scroll can be applied directly.
> 
> This re-introduces the fast path implemented in PLC::FrameViewDidScroll.
> 
> Test coverage: all layout tests which use main-thread scrolling of a
> composited layer (e.g. using window.scrollBy or gestures on scrollbars).
> 
> Bug:  770343 
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
> Change-Id: I93a43072d19871611fa8845758410b094d67a8f7
> Reviewed-on: https://chromium-review.googlesource.com/923089
> Reviewed-by: Steve Kobes <skobes@chromium.org>
> Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#537143}

TBR=szager@chromium.org,chrishtr@chromium.org,skobes@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug:  770343 
Change-Id: I9ea536a54cdc6868a451723e7c889086ad213cca
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Reviewed-on: https://chromium-review.googlesource.com/928861
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538148}
[modify] https://crrev.com/e0c819ef2ef21b3580dbf5458cc3f966c2dbc9e1/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Blockedon: 811437
Blockedon: 814154
Blockedon: 813875
Blockedon: 813969
Blockedon: 814037
Blockedon: 814236
Blockedon: 814684
Blockedon: 814251
Project Member

Comment 24 by 42576172...@developer.gserviceaccount.com, Feb 27 2018

😿 Pinpoint job stopped with an error.
https://pinpoint-dot-chromeperf.appspot.com/job/14996190440000
Blockedon: -813875
Blockedon: -813884
Project Member

Comment 27 by bugdroid1@chromium.org, Mar 3 2018

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

commit 9732521599b291a0703830c0d9d94c381916b7d8
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Sat Mar 03 07:01:38 2018

[RLS] Re-land: skip compositing steps on frame scroll.

This is mostly a re-land of https://chromium-review.googlesource.com/c/chromium/src/+/923089,
now that a squashing bug was fixed in
https://chromium.googlesource.com/chromium/src/+/8e4234fdc272ddda5ec9c156a2397c64d7a69f60.

It differs from a straight-reland in that it also does not mark the PaintLayer with
SetNeedsGraphicsLayerUpdate.

Bug:  770343 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: If4a29f30b42ff45eb6a456bced4ab2e837f81d3e
Reviewed-on: https://chromium-review.googlesource.com/947579
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540746}
[modify] https://crrev.com/9732521599b291a0703830c0d9d94c381916b7d8/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Blockedon: 809499
Blockedon: 813956
Blockedon: 814216
Project Member

Comment 31 by bugdroid1@chromium.org, Mar 7 2018

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

commit a9ecdb682cb7f480abab944bc322894e828a3eaf
Author: Stefan Zager <szager@chromium.org>
Date: Wed Mar 07 02:12:12 2018

[RootLayerScrolling] Delay call to FrameRectsChanged on overflow scroll.

In the non-RLS code path, when the FrameView's scroll offset changes,
pending_scroll_delta_ is modified, and some of the work is delayed until
the next lifecycle update.  Calling FrameRectsChanged() on every overflow
scroll has a significant performance impact, so this patch replicates the
non-RLS behavior of FrameView by postponing the call to FrameRectsChanged.

BUG= 770343 

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I10cf0782852dcf1c8021a7a62ce0078aae297e39
Reviewed-on: https://chromium-review.googlesource.com/951641
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541288}
[modify] https://crrev.com/a9ecdb682cb7f480abab944bc322894e828a3eaf/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
[modify] https://crrev.com/a9ecdb682cb7f480abab944bc322894e828a3eaf/third_party/WebKit/Source/core/frame/LocalFrameView.h
[modify] https://crrev.com/a9ecdb682cb7f480abab944bc322894e828a3eaf/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Comment 32 by bokan@chromium.org, Mar 13 2018

Blockedon: -814216

Comment 33 by bokan@chromium.org, Mar 14 2018

Blockedon: 821953
Blockedon: 822877
Blockedon: 818768
Blockedon: 809485
Blockedon: 823999
Blockedon: 823997
Hello!

RootLayerScrolling increases frame times of scroll on https://mail.yandex.ru by ~60%
GPU-rasterization is off.
Do you have any ideas?
result2.png
81.1 KB View Download
result1.png
39.6 KB View Download
re comment #39: please file a separate bug, blocking this one, and include steps to reproduce.
Blockedon: 833316
Blocking: -417782 823365
Status: Fixed (was: Assigned)

Sign in to add a comment