Bug 186733 - ensurePropertyReplacementWatchpointSet wastes 308KB of HashTable capacity on cnn.com
Summary: ensurePropertyReplacementWatchpointSet wastes 308KB of HashTable capacity on ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (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:28 PDT by Simon Fraser (smfr)
Modified: 2018-06-16 12:33 PDT (History)
4 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:28:12 PDT
Using tooling from bug 186698, loading can and running "notifyutil -p com.apple.WebKit.dumpHashTableCapacity" shows:

Wasted capacity: 168032 bytes (used 34720 of 202752 bytes, utilization: 17.12%) - 1441 allocations
1   0x116684e05 WTF::HashTable<int, WTF::KeyValuePair<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >, WTF::IntHash<int>, WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::KeyValuePairTraits, WTF::UnsignedWithZeroKeyHashTraits<int> >::HashTable()
2   0x116684de5 WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::HashMap()
3   0x116684dc5 WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::HashMap()
4   0x1166754f2 JSC::Structure::ensurePropertyReplacementWatchpointSet(JSC::VM&, int)
5   0x1157cf3af JSC::PropertyCondition::isWatchableWhenValid(JSC::Structure*, JSC::PropertyCondition::WatchabilityEffort) const
6   0x1157cf510 JSC::PropertyCondition::isWatchable(JSC::Structure*, JSC::JSObject*, JSC::PropertyCondition::WatchabilityEffort) const
7   0x1157bdca0 JSC::ObjectPropertyCondition::isWatchable(JSC::Structure*, JSC::PropertyCondition::WatchabilityEffort) const
8   0x1157bb17b JSC::ObjectPropertyCondition::isWatchable(JSC::PropertyCondition::WatchabilityEffort) const
Comment 1 Radar WebKit Bug Importer 2018-06-16 12:28:35 PDT
<rdar://problem/41189144>
Comment 2 Simon Fraser (smfr) 2018-06-16 12:29:58 PDT
Also this code path:

Wasted capacity: 140416 bytes (used 44928 of 185344 bytes, utilization: 24.24%) - 1018 allocations
1   0x116684e05 WTF::HashTable<int, WTF::KeyValuePair<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >, WTF::IntHash<int>, WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::KeyValuePairTraits, WTF::UnsignedWithZeroKeyHashTraits<int> >::HashTable()
2   0x116684de5 WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::HashMap()
3   0x116684dc5 WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::HashMap()
4   0x1166754f2 JSC::Structure::ensurePropertyReplacementWatchpointSet(JSC::VM&, int)
5   0x116675b58 JSC::Structure::didCachePropertyReplacement(JSC::VM&, int)
6   0x11626c20a llint_slow_path_put_by_id
7   0x11531710f llint_entry
8   0x11531b8d6 llint_entry
Comment 3 Simon Fraser (smfr) 2018-06-16 12:33:47 PDT
Also:

Wasted capacity: 67888 bytes (used 18000 of 85888 bytes, utilization: 20.96%) - 551 allocations
1   0x116684e05 WTF::HashTable<int, WTF::KeyValuePair<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >, WTF::IntHash<int>, WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::KeyValuePairTraits, WTF::UnsignedWithZeroKeyHashTraits<int> >::HashTable()
2   0x116684de5 WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::HashMap()
3   0x116684dc5 WTF::HashMap<int, WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<WTF::RefPtr<JSC::WatchpointSet, WTF::DumbPtrTraits<JSC::WatchpointSet> > > >::HashMap()
4   0x1166754f2 JSC::Structure::ensurePropertyReplacementWatchpointSet(JSC::VM&, int)
5   0x1156e0cb3 JSC::Structure::startWatchingPropertyForReplacements(JSC::VM&, int)
6   0x11624959d JSC::tryCacheGetByID(JSC::ExecState*, JSC::JSValue, JSC::Identifier const&, JSC::PropertySlot const&, JSC::StructureStubInfo&, JSC::GetByIDKind)
7   0x116247627 JSC::repatchGetByID(JSC::ExecState*, JSC::JSValue, JSC::Identifier const&, JSC::PropertySlot const&, JSC::StructureStubInfo&, JSC::GetByIDKind)
8   0x116226f97 operationGetByIdOptimize::$_1::operator()(bool, JSC::PropertySlot&) const