Bug 186741

Summary: FontCascadeFonts WidthCache wastes 170KB of HashTable capacity on nytimes.com
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: mmaxfield, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Simon Fraser (smfr) 2018-06-16 12:42:18 PDT
Using tooling from bug 186698, loading can and running "notifyutil -p com.apple.WebKit.dumpHashTableCapacity" shows:

Wasted capacity: 170920 bytes (used 85720 of 256640 bytes, utilization: 33.40%) - 137 allocations
1   0x10834b3c5 WTF::HashTable<WebCore::WidthCache::SmallStringKey, WTF::KeyValuePair<WebCore::WidthCache::SmallStringKey, float>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::WidthCache::SmallStringKey, float> >, WebCore::WidthCache::SmallStringKeyHash, WTF::HashMap<WebCore::WidthCache::SmallStringKey, float, WebCore::WidthCache::SmallStringKeyHash, WebCore::WidthCache::SmallStringKeyHashTraits, WTF::HashTraits<float> >::KeyValuePairTraits, WebCore::WidthCache::SmallStringKeyHashTraits>::HashTable()
2   0x10834b3a5 WTF::HashMap<WebCore::WidthCache::SmallStringKey, float, WebCore::WidthCache::SmallStringKeyHash, WebCore::WidthCache::SmallStringKeyHashTraits, WTF::HashTraits<float> >::HashMap()
3   0x10834b225 WTF::HashMap<WebCore::WidthCache::SmallStringKey, float, WebCore::WidthCache::SmallStringKeyHash, WebCore::WidthCache::SmallStringKeyHashTraits, WTF::HashTraits<float> >::HashMap()
4   0x10834b1de WebCore::WidthCache::WidthCache()
5   0x10833b065 WebCore::WidthCache::WidthCache()
6   0x10833aee7 WebCore::FontCascadeFonts::FontCascadeFonts(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&)
7   0x10833b0cd WebCore::FontCascadeFonts::FontCascadeFonts(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&)
8   0x10834378f WebCore::FontCascadeFonts::create(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&)
Comment 1 Radar WebKit Bug Importer 2018-06-16 12:42:38 PDT
<rdar://problem/41189283>