Bug 186731 - RuleFeatureSet wastes 185KB of HashTable capacity on cnn.com
Summary: RuleFeatureSet wastes 185KB of HashTable capacity on cnn.com
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-16 12:26 PDT by Simon Fraser (smfr)
Modified: 2018-06-16 12:33 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2018-06-16 12:26:28 PDT
Using tooling from bug 186698, loading can and running "notifyutil -p com.apple.WebKit.dumpHashTableCapacity" shows:

Wasted capacity: 185536 bytes (used 91968 of 277504 bytes, utilization: 33.14%) - 145 allocations
1   0x1074e1d45 WTF::HashTable<WTF::AtomicString, WTF::KeyValuePair<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >, WTF::AtomicStringHash, WTF::HashMap<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > >, WTF::AtomicStringHash, WTF::HashTraits<WTF::AtomicString>, WTF::HashTraits<std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >::KeyValuePairTraits, WTF::HashTraits<WTF::AtomicString> >::HashTable()
2   0x1074e1d25 WTF::HashMap<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > >, WTF::AtomicStringHash, WTF::HashTraits<WTF::AtomicString>, WTF::HashTraits<std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >::HashMap()
3   0x1074e1c95 WTF::HashMap<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > >, WTF::AtomicStringHash, WTF::HashTraits<WTF::AtomicString>, WTF::HashTraits<std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >::HashMap()
4   0x1074e1c13 WebCore::RuleFeatureSet::RuleFeatureSet()
5   0x1074ddaa5 WebCore::RuleFeatureSet::RuleFeatureSet()
6   0x1074dd54d WebCore::DocumentRuleSets::DocumentRuleSets(WebCore::StyleResolver&)
7   0x1074ddb0d WebCore::DocumentRuleSets::DocumentRuleSets(WebCore::StyleResolver&)
8   0x10754e60f WebCore::StyleResolver::StyleResolver(WebCore::Document&)
Comment 1 Radar WebKit Bug Importer 2018-06-16 12:26:50 PDT
<rdar://problem/41189113>
Comment 2 Simon Fraser (smfr) 2018-06-16 12:33:06 PDT
Also this code path:

Wasted capacity: 97504 bytes (used 34848 of 132352 bytes, utilization: 26.33%) - 145 allocations
1   0x1074e1d45 WTF::HashTable<WTF::AtomicString, WTF::KeyValuePair<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >, WTF::AtomicStringHash, WTF::HashMap<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > >, WTF::AtomicStringHash, WTF::HashTraits<WTF::AtomicString>, WTF::HashTraits<std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >::KeyValuePairTraits, WTF::HashTraits<WTF::AtomicString> >::HashTable()
2   0x1074e1d25 WTF::HashMap<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > >, WTF::AtomicStringHash, WTF::HashTraits<WTF::AtomicString>, WTF::HashTraits<std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >::HashMap()
3   0x1074e1c95 WTF::HashMap<WTF::AtomicString, std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > >, WTF::AtomicStringHash, WTF::HashTraits<WTF::AtomicString>, WTF::HashTraits<std::__1::unique_ptr<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul>, std::__1::default_delete<WTF::Vector<WebCore::RuleFeature, 0ul, WTF::CrashOnOverflow, 16ul> > > > >::HashMap()
4   0x1074e1c13 WebCore::RuleFeatureSet::RuleFeatureSet()
5   0x1074ddaa5 WebCore::RuleFeatureSet::RuleFeatureSet()
6   0x10752a80b WebCore::RuleSet::RuleSet()
7   0x10752a855 WebCore::RuleSet::RuleSet()
8   0x1074deeb2 WebCore::DocumentRuleSets::resetAuthorStyle()