[LayoutNG] NGExclusionSpace::GetDerivedGeometry is slow |
||
Issue descriptionWhen loading the single-page HTML5 spec 30% of the layout time (and over 10% of all time_ is spent in NGExclusionSpace::GetDerivedGeometry. Allocation only accounts for a small fraction of that. (see lower left corner of attached profile)
,
Aug 13
,
Aug 14
Interestingly we spent a lot of time not only in DerivedGeometry::Add but also in NGExclusionSpace::GetDerivedGeometry itself.
,
Aug 21
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/96d484e204b0a1c42afa3f65d7840df3624bab09 commit 96d484e204b0a1c42afa3f65d7840df3624bab09 Author: Ian Kilpatrick <ikilpatrick@chromium.org> Date: Tue Aug 21 12:10:54 2018 [LayoutNG] Fix NGExclusionSpace perf for html5 spec. This patch does three things: 1) Moves cloning the exclusion space in NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild to later, as currently it get queried immediately after cloning, causing the exclusion space to regenerate its data. 2) Adds a bypasses for the cases where we are going to clear all floats and we can just return the maximum available area. 3) For the case where an element isn't clearing anything, just return LayoutUnit::Min(). Bug: 873799 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: Ie04b80a774348303b248d725cf402751f7a651a1 Reviewed-on: https://chromium-review.googlesource.com/1181125 Reviewed-by: Emil A Eklund <eae@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Commit-Queue: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#584719} [modify] https://crrev.com/96d484e204b0a1c42afa3f65d7840df3624bab09/third_party/blink/renderer/core/layout/ng/exclusions/ng_exclusion_space.cc [modify] https://crrev.com/96d484e204b0a1c42afa3f65d7840df3624bab09/third_party/blink/renderer/core/layout/ng/exclusions/ng_exclusion_space.h [modify] https://crrev.com/96d484e204b0a1c42afa3f65d7840df3624bab09/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
,
Aug 21
Verified, now down to less than 1% (down from 30%) |
||
►
Sign in to add a comment |
||
Comment 1 by e...@chromium.org
, Aug 13