<?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>156250</bug_id>
          
          <creation_ts>2016-04-05 14:21:37 -0700</creation_ts>
          <short_desc>Web Inspector: Aggressive DOM updates slow down page and Inspector (protocol starving)</short_desc>
          <delta_ts>2017-01-01 22:27:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.11</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          <dependson>158504</dependson>
    
    <dependson>158513</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jamie White">jamie</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
    
    <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1180974</commentid>
    <comment_count>0</comment_count>
      <attachid>275695</attachid>
    <who name="Jamie White">jamie</who>
    <bug_when>2016-04-05 14:21:37 -0700</bug_when>
    <thetext>Created attachment 275695
Simple test page

Steps to reproduce:

1. Load the test page
2. Click &quot;Start&quot;
3. Open the inspector with alt+cmd+i (should open on elements tab with body closed)
4. Note ms/frame (~10 on my early 2015 MacBook Air)
5. Switch to console tab
6. Note ms/frame increases (~40 on my machine)

To be clear: I expect some slow down when the elements tab is open, but only modest slow down when the console tab is open.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1180975</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-04-05 14:23:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/25561452&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1180990</commentid>
    <comment_count>2</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2016-04-05 15:12:46 -0700</bug_when>
    <thetext>The protocol traffic from the DOM agent is starving things. You basically can&apos;t do anything in the Inspector with this much protocol traffic. We should look at coalescing the DOM agent events.

Note: Chrome Canary DevTools hang worse for me. I can&apos;t even type in the Console there. If you start on Console in Chrome, you are fine. But if you ever show the Elements panel, and later switch to Console is hangs.

I can type in Safari Web Inspector, just without autocomplete results, or anything happening quickly after pressing enter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1181198</commentid>
    <comment_count>3</comment_count>
    <who name="Jamie White">jamie</who>
    <bug_when>2016-04-06 01:05:09 -0700</bug_when>
    <thetext>Honestly this repro is more of a generic stress test. Did you see the effect I mentioned where the lag is only introduced after switching inspector tabs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1181241</commentid>
    <comment_count>4</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2016-04-06 07:11:18 -0700</bug_when>
    <thetext>Yes, switching tabs does have an effect in Web Inspector. The effect is much worse in Chrome Dev Tools. We should fix this.

In general any where the page is busy, that causes a lot of Inspector protocol traffic, which makes it hard to do any outgoing commands. Also it taxes the CPU and starves the Web Inspector process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262492</commentid>
    <comment_count>5</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-12-22 17:49:04 -0800</bug_when>
    <thetext>We did some performance work for this. Please reopen if you find pages that stall out still (and are not stupid microbenchmarks).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262527</commentid>
    <comment_count>6</comment_count>
    <who name="Jamie White">jamie</who>
    <bug_when>2016-12-22 22:13:53 -0800</bug_when>
    <thetext>Thanks Brian. Just to clarify: is the &quot;Simple test page&quot; attached to this ticket an example of a stupid microbenchmark? (Totally frank question, keen to learn what constitutes a useful repro).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262594</commentid>
    <comment_count>7</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-12-23 12:21:00 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Thanks Brian. Just to clarify: is the &quot;Simple test page&quot; attached to this
&gt; ticket an example of a stupid microbenchmark? (Totally frank question, keen
&gt; to learn what constitutes a useful repro).

I hate to be dismissive, but unfortunately yes :(.

I was using d3 SVG animations (from d3 gallery) as a more realistic test case that does spam attribute changes. In trunk it is not silky smooth but it&apos;s usable at least. If you find otherwise, then there is cause to optimize it further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262601</commentid>
    <comment_count>8</comment_count>
    <who name="Jamie White">jamie</who>
    <bug_when>2016-12-23 13:13:01 -0800</bug_when>
    <thetext>Ok, that&apos;s useful to know. The original case that led to this ticket was an ember app that slowed down noticeably with the inspector open (it still does) but I figured there was way too much noise to be useful so whittled it down to something minimal that still demonstrated the particular issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262606</commentid>
    <comment_count>9</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-12-23 15:12:46 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; Ok, that&apos;s useful to know. The original case that led to this ticket was an
&gt; ember app that slowed down noticeably with the inspector open (it still
&gt; does) but I figured there was way too much noise to be useful so whittled it
&gt; down to something minimal that still demonstrated the particular issue.

Performance here also depends on the distribution of attribute updates to DOM elements, how often elements are added/removed, how many different properties are being changed, etc. It would probably be better to start with the real world example so that I can capture some of these properties before trying to optimize our implementation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263252</commentid>
    <comment_count>10</comment_count>
    <who name="Jamie White">jamie</who>
    <bug_when>2017-01-01 22:27:29 -0800</bug_when>
    <thetext>Just a note that the issues I described previously match those described here:
https://bugs.webkit.org/show_bug.cgi?id=158117</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>275695</attachid>
            <date>2016-04-05 14:21:37 -0700</date>
            <delta_ts>2016-04-05 14:21:37 -0700</delta_ts>
            <desc>Simple test page</desc>
            <filename>repro.html</filename>
            <type>text/html</type>
            <size>1377</size>
            <attacher name="Jamie White">jamie</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPlNhZmFyaSBJbnNwZWN0
b3IgUGVyZiBSZXBybzwvdGl0bGU+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPGJ1dHRvbiBvbmNs
aWNrPSJ0b2dnbGUodGhpcykiPlN0YXJ0PC9idXR0b24+CiAgICA8c3BhbiBpZD0iYXZnIj48L3Nw
YW4+IG1zL2ZyYW1lCiAgICA8c2NyaXB0PgogICAgICB2YXIgc3RhdGUgPSAncGF1c2VkJzsKICAg
ICAgdmFyIGF2Z1dpbmRvdyA9IDEwOwogICAgICB2YXIgZWxDb3VudCA9IDEwMDA7CiAgICAgIHZh
ciBlbHMgPSBuZXcgQXJyYXkoZWxDb3VudCk7CiAgICAgIHZhciB0aW1lcyA9IG5ldyBBcnJheShh
dmdXaW5kb3cpOwogICAgICB2YXIgYXZnRWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnYXZn
Jyk7CgogICAgICBmdW5jdGlvbiByZW5kZXIoKSB7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkg
PCBlbENvdW50OyBpKyspIHsKICAgICAgICAgIHZhciBlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1l
bnQoJ2RpdicpOwogICAgICAgICA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JvZHk+
CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>