<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>186733</bug_id>
          
          <creation_ts>2018-06-16 12:28:12 -0700</creation_ts>
          <short_desc>ensurePropertyReplacementWatchpointSet wastes 308KB of HashTable capacity on cnn.com</short_desc>
          <delta_ts>2018-06-16 12:33:47 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>keith_miller</cc>
    
    <cc>saam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1433782</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-06-16 12:28:12 -0700</bug_when>
    <thetext>Using tooling from bug 186698, loading can and running &quot;notifyutil -p com.apple.WebKit.dumpHashTableCapacity&quot; shows:

Wasted capacity: 168032 bytes (used 34720 of 202752 bytes, utilization: 17.12%) - 1441 allocations
1   0x116684e05 WTF::HashTable&lt;int, WTF::KeyValuePair&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt;, WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::HashMap&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;::KeyValuePairTraits, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt; &gt;::HashTable()
2   0x116684de5 WTF::HashMap&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;::HashMap()
3   0x116684dc5 WTF::HashMap&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;::HashMap()
4   0x1166754f2 JSC::Structure::ensurePropertyReplacementWatchpointSet(JSC::VM&amp;, 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1433783</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-06-16 12:28:35 -0700</bug_when>
    <thetext>&lt;rdar://problem/41189144&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1433786</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-06-16 12:29:58 -0700</bug_when>
    <thetext>Also this code path:

Wasted capacity: 140416 bytes (used 44928 of 185344 bytes, utilization: 24.24%) - 1018 allocations
1   0x116684e05 WTF::HashTable&lt;int, WTF::KeyValuePair&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt;, WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::HashMap&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;::KeyValuePairTraits, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt; &gt;::HashTable()
2   0x116684de5 WTF::HashMap&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;::HashMap()
3   0x116684dc5 WTF::HashMap&lt;int, WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;JSC::WatchpointSet, WTF::DumbPtrTraits&lt;JSC::WatchpointSet&gt; &gt; &gt; &gt;::HashMap()
4   0x1166754f2 JSC::Structure::ensurePropertyReplacementWatchpointSet(JSC::VM&amp;, int)
5   0x116675b58 JSC::Structure::didCachePropertyReplacement(JSC::VM&amp;, int)
6   0x11626c20a llint_slow_path_put_by_id
7   0x11531710f llint_entry
8   0x11531b8d6 llint_entry</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1433796</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-06-16 12:33:47 -0700</bug_when>
    <thetext>Also:

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

    </bug>

</bugzilla>