<?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>152221</bug_id>
          
          <creation_ts>2015-12-12 21:40:54 -0800</creation_ts>
          <short_desc>Web Inspector: Don&apos;t render console messages until Console is opened</short_desc>
          <delta_ts>2016-05-02 11:50:32 -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>Web Inspector</component>
          <version>WebKit Local Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>155629</dup_id>
          
          <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>
          
          <blocked>152220</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikita Vasilyev">nvasilyev</reporter>
          <assigned_to name="Nikita Vasilyev">nvasilyev</assigned_to>
          <cc>bburg</cc>
    
    <cc>giovanni.piller</cc>
    
    <cc>graouts</cc>
    
    <cc>joepeck</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1148780</commentid>
    <comment_count>0</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2015-12-12 21:40:54 -0800</bug_when>
    <thetext>Running the following code make Web Inspector unbearably slow in a couple of minutes:

setInterval(function() {
    console.log({x: Math.random()})
}, 200);

The low hanging fruit would be to simply not update Console&apos;s DOM when it isn&apos;t visible,
e.d. the split console is closed and the active tab isn&apos;t Console.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148783</commentid>
    <comment_count>1</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2015-12-12 22:14:35 -0800</bug_when>
    <thetext>When the console isn&apos;t visible, the console content view is already not present in the DOM. However,

https://github.com/WebKit/webkit/blob/master/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js#L276
WebInspector.JavaScriptLogViewController#_appendConsoleMessageView
keeps appending elements regardless of that.

When console isn&apos;t visible, it appends to a DOM element that is detached from the DOM:

&gt;&gt; this._currentConsoleGroup.element.parentNode.parentNode.parentNode
-&gt; null

I wonder if modifying detached DOM is still making Web Inspector slow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148787</commentid>
    <comment_count>2</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2015-12-12 22:27:27 -0800</bug_when>
    <thetext>After profiling in Timelines I noticed that I get 4 paints (!) on every console.info call when the split console is closed!

I intentionally used console.info instead of console.log that doesn&apos;t modify console message counts on the dashboard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148791</commentid>
    <comment_count>3</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2015-12-12 22:36:02 -0800</bug_when>
    <thetext>I ran the following code in Firefox DevTools and Chrome DevTools for a couple of minutes:

setInterval(function() {
    console.log({x: Math.random()})
}, 1);

Both performed well — responsive and snappy.

I profiled Chrome DevTools and it seems that they use a custom requestAnimationFrame batching. Firefox DevTools use React.js.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1189352</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-05-02 02:05:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/26037238&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1189378</commentid>
    <comment_count>5</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2016-05-02 06:05:58 -0700</bug_when>
    <thetext>Isn&apos;t this a dupe?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1189401</commentid>
    <comment_count>6</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2016-05-02 09:10:28 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 155629 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1189448</commentid>
    <comment_count>7</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-05-02 11:50:32 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Isn&apos;t this a dupe?

Yes, it is.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>