[Webkit-unassigned] [Bug 273341] New: Once you've allocated a `gOverriding...Map` it never goes away, making layout slower

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 26 15:00:25 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=273341

            Bug ID: 273341
           Summary: Once you've allocated a `gOverriding...Map` it never
                    goes away, making layout slower
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: simon.fraser at apple.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

RenderBox has:

static OverrideSizeMap* gOverridingLogicalHeightMap = nullptr;
static OverrideSizeMap* gOverridingLogicalWidthMap = nullptr;

static OverridingLengthMap* gOverridingLogicalHeightLengthMap = nullptr;
static OverridingLengthMap* gOverridingLogicalWidthLengthMap = nullptr;

static OverrideOptionalSizeMap* gOverridingContainingBlockContentLogicalHeightMap = nullptr;
static OverrideOptionalSizeMap* gOverridingContainingBlockContentLogicalWidthMap = nullptr;

which are consulted via RenderBox::overridingContainingBlockContentWidth() etc.

These maps are lazily allocated, but once allocated never go away. So if you hit a page with flexbox, which allocates a map, then all subsequent layout in that process is going to do some hash lookups, possibly slowing down layout.

These static hash maps need to go away. Their contents should only persist across one subtree layout, so they could be part of layout state or something.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240426/7c08a08e/attachment-0001.htm>


More information about the webkit-unassigned mailing list