Bug 251699

Summary: FormattingState::m_outOfFlowBoxes wastes a lot of vector capacity
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description Simon Fraser (smfr) 2023-02-03 10:26:32 PST
Using the patch in bug 186698, and testing on a wikipedia page, we see that EventListenerMap::m_entries is the second-most wasteful site for vector capacity:

Wasted capacity: 1293768 bytes (used 321640 of 1615408 bytes, utilization: 19.91%) - 219 allocations
1   0x11045bc0f WebCore::Layout::InlineFormattingState::InlineFormattingState(WebCore::Layout::LayoutState&)
2   0x11043d1fa WebCore::Layout::LayoutState::ensureInlineFormattingState(WebCore::Layout::ElementBox const&)

Wasted capacity: 27456 bytes (used 2112 of 29568 bytes, utilization: 7.14%) - 219 allocations
1   0x11044c8b9 WebCore::Layout::BlockFormattingState::BlockFormattingState(WebCore::Layout::LayoutState&, WebCore::Layout::ElementBox const&)
2   0x11043d41f WebCore::Layout::LayoutState::ensureBlockFormattingState(WebCore::Layout::ElementBox const&)
Comment 1 Radar WebKit Bug Importer 2023-02-03 10:27:04 PST
<rdar://problem/105011234>
Comment 2 Simon Fraser (smfr) 2023-02-03 10:28:27 PST
(In reply to Simon Fraser (smfr) from comment #0)
> Using the patch in bug 186698, and testing on a wikipedia page, we see that
> EventListenerMap::m_entries is the second-most wasteful site for vector
> capacity:

That should say "FormattingState::m_outOfFlowBoxes"
Comment 3 Simon Fraser (smfr) 2023-02-03 16:14:15 PST
This was based on bad data.