New issue
Advanced search Search tips

Issue 873799 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Aug 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocking:
issue 873794


Participants' hotlists:
layoutng


Sign in to add a comment

[LayoutNG] NGExclusionSpace::GetDerivedGeometry is slow

Project Member Reported by e...@chromium.org, Aug 13

Issue description

When 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)
 
Blocking: 873794
profile001.svg
153 KB Download
Interestingly we spent a lot of time not only in DerivedGeometry::Add but also in NGExclusionSpace::GetDerivedGeometry itself.
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Status: Verified (was: Assigned)
Verified, now down to less than 1% (down from 30%)

Sign in to add a comment