Optimize boundary transition events code path |
|||
Issue descriptionIt seems that we are using lot of time when processing transition events like over/out/enter/leave that we may cause some janks on a very deep DOM trees. https://output.jsbin.com/guhawu But event if the DOM is not deep there is still some room to improve to reduce the time consumed by Blink so js has more portion of time in a frame.
,
Apr 11 2016
I commented parts of the code that is related to some calculating of boundaries and the delay did get reduced but not fully disappeared. But in general I'd like to investigate beyond that as well to see if I can eliminate any redundant delays beyond that point or not.
,
Apr 11 2016
Good find Navid! The EventSender seems to be spending 280ms in my quick tracing (1840ms~2120ms)! And HitTest is only a small part of it!!
,
Apr 11 2016
Note, however, that accroding to httparchive, the average dom depth seems to be ~10, with 97% of the pages having <20: http://httparchive.org/interesting.php#avgdomdepth Any optimization that works reasonably for a max depth 30~50 should be acceptable IMO.
,
Apr 11 2016
This is a tracing log for a tree of depth 30. It is still a considerable amount of time compared to hit testing.
,
Apr 11 2016
Yes, this proves that an improvement here worth the effort. Thanks for the analysis.
,
Apr 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c49fdc54f02eb0d4fe3ca0faf620ad8d45ac77f7 commit c49fdc54f02eb0d4fe3ca0faf620ad8d45ac77f7 Author: nzolghadr <nzolghadr@chromium.org> Date: Mon Apr 25 23:23:29 2016 Change finding common ancestor from O(n^2) to O(n) Changing the method of finding the common ancestor of two nodes in the boundary transition events from O(n^2) to O(n). BUG= 602264 Review URL: https://codereview.chromium.org/1904453003 Cr-Commit-Position: refs/heads/master@{#389600} [modify] https://crrev.com/c49fdc54f02eb0d4fe3ca0faf620ad8d45ac77f7/third_party/WebKit/Source/core/input/PointerEventManager.cpp
,
Apr 26 2016
,
Jun 21 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by mustaq@chromium.org
, Apr 11 2016