Hello blink-dev,
Please take a look at the attached intent to implement for Impl threaded scrollbar scrolling.
Quick Summary:
This proposal is to move composited scrollbar scrolling to the impl thread so that even when the main thread is busy, users can continue to interact with and scroll using scrollbars. The code will live mostly in cc.
Thanks,
Rahul
Pasting the contents here:
Impl threaded scrollbar scrolling
Subject
Intent to implement Impl threaded composited scrollbar scrolling for MouseEvent(s).
Contact emails
ara...@microsoft.com, sam...@microsoft.com, dli...@microsoft.com, ri...@microsoft.com, mar...@microsoft.com
Design doc/spec
Summary
This proposal is to move composited scrollbar scrolling to the impl thread so that even when the main thread is busy, users can continue to interact with and scroll using scrollbars. The code will live mostly in cc.
Motivation
Scrollbar scrolling using the mouse happens on the main thread in Chromium. If the main thread is busy (due to reasons like long running JS, etc), scrolling by clicking on the scrollbar will appear to be janky as the events keep getting queued up on the MainThreadEventQueue, waiting for the main thread to free up. We observe on average scrollbar drags have ~2-4x higher latency in Chromium as compared to EdgeHTML today, worse on particularly busy sites. We attribute this gap primarily to EdgeHTML’s feature for off-thread scrollbar drags. By avoiding the main thread in Chromium as well, we believe we can bring the performance of scrollbar drags more in line with what we observe in EdgeHTML.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Ongoing technical constraints
None (and this feature will be staged using a base::Feature flag)
Tracking bug
938619
Demo links
Attachment to crbug.com/938619: https://bugs.chromium.org/p/chromium/issues/attachment?aid=382732&signed_aid=sAa8q1u-nTAvDsa4W8HQvA==
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/BYAPR21MB127109AF1E81EAAB8A3CA9DDA64E0%40BYAPR21MB1271.namprd21.prod.outlook.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADY3Maf1%2Boh4AZH2A6ewd5qz7E96QP1k3rDCP1iWtMR%2BfcfvsA%40mail.gmail.com.
Thanks for all your inputs :)
As David rightly said, this intent is scoped to handling composited scrollbars only. We have a CL up for handling mouse clicks on composited scrollbar arrows and are currently working out the specifics of other composited scrollbar mouse interactions (like thumb drag, keeping the mouse pressed on the arrows/track etc).
Hi everyone,
Quick update. A couple of days ago, we landed a changelist which enables support for compositor threaded scrollbar scrolling using arrows (for now).
Chrome Canary (75.0.3769.0 and higher) should have the change. You can use this test page for reference: https://rahul8805.github.io/DemoPages/main_thread_jank.html
Thanks to all the code reviewers !
In the coming days, we’ll keep adding more functionality to it 😊
Thanks,
Rahul
Updates:
More functionality (+a couple of bug fixes) has been added. Scrollbar thumb drag on the compositor thread is now supported (landed last week). Those interested in checking it out, please feel free to use this demo page.
We’re continuing to add more functionality. Continuous-scrolling (for when you click and hold the scrollbar arrow) is currently being prototyped. Thank you for all the advice and code review feedback. 😊
Update:
We’ve merged a couple of changelists that enable autoscrolling (for both, arrow and track). Please feel free to check it out using this demo page. There are still outstanding bugs that are currently being worked on.
Thanks to the code reviewers ! If you have any questions, please don’t hesitate to reach out 😊
Thanks,
Rahul Arakeri
More updates:
Improvements to smooth autoscrolling (like infinite autoscrolling) and thumb dragging (like anchoring) have now been merged. Please feel free to check it out 😊
Demo page: https://rahul8805.github.io/DemoPages/main_thread_jank.html
PS :
(Based on a Slack discussion with David Bokan about the scope).
Please note that thumb invalidation (i.e changing the color of the thumb on hover on/off) and custom scrollbars scrolling will still happen on the main thread. These need additional work and are currently out of scope for the composited scrollbar scrolling.
More updates:
Improvements to smooth autoscrolling (like infinite autoscrolling) and thumb dragging (like anchoring) have now been merged. Please feel free to check it out 😊
Demo page: https://rahul8805.github.io/DemoPages/main_thread_jank.html
PS :
(Based on a Slack discussion with David Bokan about the scope).
Please note that thumb invalidation (i.e changing the color of the thumb on hover on/off) and custom scrollbars scrolling will still happen on the main thread. These need additional work and are currently out of scope for the composited scrollbar scrolling.
Thanks,
Rahul
After a bunch of work, compositor threaded scrollbar scrolling is finally on by default in chromium master. Today’s Chrome canary (82.0.4072.0) has it ON. Thanks to all those who helped and guided me along the way. This will be a perf win for scrolling on chromium based browsers and takes us all one step closer towards scrolling unification. 😃
Example of scrollbar drag when main thread is busy:
FEATURE OFF
Histogram: Event.Latency.ScrollUpdate.Scrollbar.TimeToScrollUpdateSwapBegin4 recorded 19 samples, mean = 240325.4 (flags = 0x41)
0 ...
109350 ----O (1 = 5.3%) {0.0%}
126669 ...
169971 ----O (1 = 5.3%) {5.3%}
196891 O (0 = 0.0%) {10.5%}
228075 ------------------------------------------------------------------------O (17 = 89.5%) {10.5%}
264198 ...
FEATURE ON
Histogram: Event.Latency.ScrollUpdate.Scrollbar.TimeToScrollUpdateSwapBegin4 recorded 58 samples, mean = 14517.3 (flags = 0x41)
0 ...
10403 -----------------------------------------------O (11 = 19.0%) {0.0%}
12051 -----------------------------------------------------------O (14 = 24.1%) {19.0%}
13960 ------------------------------------------------------------------------O (17 = 29.3%) {43.1%}
16171 -----------------------------------------------------------O (14 = 24.1%) {72.4%}
18732 --------O (2 = 3.4%) {96.6%}
21699 ...
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/9a0cd072-7533-4aef-b590-b6d2a383fa18%40chromium.org.