Bug 251725

Summary: FloatingState::m_floats wastes 30KB of vector capacity
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Simon Fraser (smfr) 2023-02-03 16:16:58 PST
Using the patch in bug 186698, and testing on a wikipedia page, we see that FloatingState::m_floats wastes 30KB of vector capacity:

Wasted capacity: 30888 bytes (used 2392 of 33280 bytes, utilization: 7.19%) - 216 allocations
5   0x82646e57d WTF::VectorBuffer<WebCore::Layout::FloatingState::FloatItem, 0ul, WTF::FastMalloc>::VectorBuffer()
6   0x82646e545 WTF::Vector<WebCore::Layout::FloatingState::FloatItem, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>::Vector()
7   0x82644b9c5 WTF::Vector<WebCore::Layout::FloatingState::FloatItem, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>::Vector()
8   0x82644b91d WebCore::Layout::FloatingState::FloatingState(WebCore::Layout::LayoutState&, WebCore::Layout::ElementBox const&)
9   0x82644ba15 WebCore::Layout::FloatingState::FloatingState(WebCore::Layout::LayoutState&, WebCore::Layout::ElementBox const&)
10  0x826460b4c WebCore::Layout::BlockFormattingState::BlockFormattingState(WebCore::Layout::LayoutState&, WebCore::Layout::ElementBox const&)
11  0x826460be5 WebCore::Layout::BlockFormattingState::BlockFormattingState(WebCore::Layout::LayoutState&, WebCore::Layout::ElementBox const&)
Comment 1 Radar WebKit Bug Importer 2023-02-03 16:17:18 PST
<rdar://problem/105025457>
Comment 2 zalan 2023-02-06 10:02:01 PST
Created attachment 464866 [details]
Patch
Comment 3 EWS 2023-02-06 12:46:31 PST
Committed 259909@main (f2ad1fd561f5): <https://commits.webkit.org/259909@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 464866 [details].