<?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>86813</bug_id>
          
          <creation_ts>2012-05-17 23:16:46 -0700</creation_ts>
          <short_desc>WebKit spends ~20% of time in HTMLTextAreaElement::defaultValue() when opening a review page</short_desc>
          <delta_ts>2013-08-09 16:52: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>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>86994</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>abarth</cc>
    
    <cc>adele</cc>
    
    <cc>aestes</cc>
    
    <cc>ap</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>darin</cc>
    
    <cc>dbates</cc>
    
    <cc>eric</cc>
    
    <cc>fpizlo</cc>
    
    <cc>kling</cc>
    
    <cc>koivisto</cc>
    
    <cc>mifenton</cc>
    
    <cc>ojan</cc>
    
    <cc>rafael.lobo</cc>
    
    <cc>tkent</cc>
    
    <cc>tonikitoo</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>627376</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-17 23:16:46 -0700</bug_when>
    <thetext>Reproduction steps:
1. Open https://bugs.webkit.org/attachment.cgi?id=142634 (Caution: 5MB!)
2. Instrument the Web Process while WebKit opens it

Observe that we spend 19.5% of time in HTMLTextAreaElement::defaultValue() inside HTMLTextAreaElement::childrenChanged, which in turn is called by ContainerNode::parserAddChild (18.5%).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627379</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-17 23:19:35 -0700</bug_when>
    <thetext>Obviously, we should be using StringBuilder in this function. But even then we still have O(n^2) algorithm here because parserAddChild is going to call this function whenever new child is added :(

373	String HTMLTextAreaElement::defaultValue() const
374	{
375	    String value = &quot;&quot;;
376	
377	    // Since there may be comments, ignore nodes other than text nodes.
378	    for (Node* n = firstChild(); n; n = n-&gt;nextSibling()) {
379	        if (n-&gt;isTextNode())
380	            value += toText(n)-&gt;data();
381	    }
382	
383	    return value;
384	}

Perhaps we can lazily update the default value when the parser is adding children?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627386</commentid>
    <comment_count>2</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-05-17 23:28:54 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; Reproduction steps:
&gt; 1. Open https://bugs.webkit.org/attachment.cgi?id=142634 (Caution: 5MB!)
&gt; 2. Instrument the Web Process while WebKit opens it
&gt; 
&gt; Observe that we spend 19.5% of time in HTMLTextAreaElement::defaultValue() inside HTMLTextAreaElement::childrenChanged, which in turn is called by ContainerNode::parserAddChild (18.5%).

Did you link to the wrong page? There&apos;s no textareas on that page, just plain text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627391</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-17 23:32:37 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Did you link to the wrong page? There&apos;s no textareas on that page, just plain text.

Oh sorry, I meant https://bugs.webkit.org/attachment.cgi?id=142634&amp;action=review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627398</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-05-17 23:43:50 -0700</bug_when>
    <thetext>We should be able to tell that we&apos;re still during a parse and do it during the finishedParsingChildren method, or whatever it&apos;s named these days.  the &quot;we just parsed the end tag&quot; method.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627400</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-17 23:45:44 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; We should be able to tell that we&apos;re still during a parse and do it during the finishedParsingChildren method, or whatever it&apos;s named these days.  the &quot;we just parsed the end tag&quot; method.

Can scripts run while parsing textarea content?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627402</commentid>
    <comment_count>6</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-05-17 23:47:50 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; We should be able to tell that we&apos;re still during a parse and do it during the finishedParsingChildren method, or whatever it&apos;s named these days.  the &quot;we just parsed the end tag&quot; method.
&gt; 
&gt; Can scripts run while parsing textarea content?

Even if they can&apos;t currently, it feels safer to assume that they could. Imagine the horror if someone made it so that scripts could run while parsing textarea content and we had put in an optimization that relied on them not running.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627403</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-05-17 23:48:10 -0700</bug_when>
    <thetext>We could be in the middle of a &lt;textArea&gt; when the parser pauses and scripts run (from a load or whatever), sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627410</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-17 23:54:16 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; We could be in the middle of a &lt;textArea&gt; when the parser pauses and scripts run (from a load or whatever), sure.

I see. That makes things a little tricker I guess because some Web-facing API relies on the fact we update values whenever children changes. So there&apos;s some book keeping to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627411</commentid>
    <comment_count>9</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-05-17 23:56:15 -0700</bug_when>
    <thetext>Lots of web-facing apis rely on the fact that we layout/resolve-style before we return them values. :)  Similarly we would need to keep a dirty bit here and know to refresh our cache whenever those are called.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627412</commentid>
    <comment_count>10</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-05-17 23:56:56 -0700</bug_when>
    <thetext>I can&apos;t even load the page on my laptop. :(

If I could, I&apos;d try to understand what textareas are so slow. Only think I can think of is that we load the old review page in an iframe that contains the full diff as text in the textarea. I could imagine that being slow. It&apos;s silly through really. We don&apos;t need to load the diff in that iframe at all anymore. Noone uses the old review page anymore.

We should fix the inefficiency on the C++ side first of course, but after that, we should just change the review page to not be dumb.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629209</commentid>
    <comment_count>11</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-05-21 09:51:12 -0700</bug_when>
    <thetext>Can anyone think of a valid use for String::operator+=()?  If not we should just remove it and make all current clients use StringBuilder instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629295</commentid>
    <comment_count>12</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 11:26:37 -0700</bug_when>
    <thetext>It appears that just using StringBuilder instead of operator+= will fix this perf. hit. Now we&apos;re spending roughly 8% of time in treeScope() :( Someone needs to make treeScope O(1). It&apos;s showing up every time I profile some DOM operation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629306</commentid>
    <comment_count>13</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 11:33:23 -0700</bug_when>
    <thetext>Filed https://bugs.webkit.org/show_bug.cgi?id=87034 to track treeScope() slowness per Dimitri&apos;s request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629338</commentid>
    <comment_count>14</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 11:55:27 -0700</bug_when>
    <thetext>We could also lazy construct string at finishParsingChildren (paired with beginParsingChildren) but maybe we can do something more general like not replacing all children in the shadow DOM when some nodes match.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629354</commentid>
    <comment_count>15</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 12:05:47 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; We could also lazy construct string at finishParsingChildren (paired with beginParsingChildren) but maybe we can do something more general like not replacing all children in the shadow DOM when some nodes match.

Turns out that this requires a considerable amount of refactoring. Let&apos;s just replace String by StringBuilder for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629497</commentid>
    <comment_count>16</comment_count>
      <attachid>143097</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 14:30:20 -0700</bug_when>
    <thetext>Created attachment 143097
Fixes the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629516</commentid>
    <comment_count>17</comment_count>
      <attachid>143097</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-05-21 14:38:28 -0700</bug_when>
    <thetext>Comment on attachment 143097
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=143097&amp;action=review

LGTM.

&gt; Source/WebCore/ChangeLog:13
&gt; +        Also avoid the redundant call to setValue in childrenChaned when the value is dirty.

childrenChaned!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629527</commentid>
    <comment_count>18</comment_count>
      <attachid>143101</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 14:47:49 -0700</bug_when>
    <thetext>Created attachment 143101
Patch for landing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629529</commentid>
    <comment_count>19</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-21 14:50:31 -0700</bug_when>
    <thetext>I&apos;m going to hold off on landing this patch until the bug 86994 is fixed (hopefully later today).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>631389</commentid>
    <comment_count>20</comment_count>
      <attachid>143101</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-05-23 01:49:26 -0700</bug_when>
    <thetext>Comment on attachment 143101
Patch for landing

Clearing flags on attachment: 143101

Committed r118149: &lt;http://trac.webkit.org/changeset/118149&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>631390</commentid>
    <comment_count>21</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-05-23 01:49:33 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>632350</commentid>
    <comment_count>22</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-23 19:58:43 -0700</bug_when>
    <thetext>This patch improved the score of tests added by the bug 86994 by 1000-3000%:
http://webkit-perf.appspot.com/graph.html#tests=[[2831883,2001,3001],[2831883,2001,173262],[2831883,2001,963028],[2831883,2001,957069],[2831883,2001,2389050],[2965621,2001,32196],[2965621,2001,957069],[2965621,2001,173262],[2965621,2001,2389050],[2965621,2001,3001],[2965621,2001,963028],[2831883,2001,32196]]&amp;sel=1337223431149,1337828231149&amp;displayrange=7&amp;datatype=running</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>632386</commentid>
    <comment_count>23</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-05-23 20:53:04 -0700</bug_when>
    <thetext>(In reply to comment #22)
&gt; This patch improved the score of tests added by the bug 86994 by 1000-3000%:
&gt; http://webkit-perf.appspot.com/graph.html#tests=[[2831883,2001,3001],[2831883,2001,173262],[2831883,2001,963028],[2831883,2001,957069],[2831883,2001,2389050],[2965621,2001,32196],[2965621,2001,957069],[2965621,2001,173262],[2965621,2001,2389050],[2965621,2001,3001],[2965621,2001,963028],[2831883,2001,32196]]&amp;sel=1337223431149,1337828231149&amp;displayrange=7&amp;datatype=running

Cool!
textarea-dom.html: Huge improvement
textarea-parsing.html: 4% improvement
textarea-edit.html: Not affected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>632407</commentid>
    <comment_count>24</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-23 21:39:16 -0700</bug_when>
    <thetext>(In reply to comment #23)
&gt; Cool!
&gt; textarea-dom.html: Huge improvement
&gt; textarea-parsing.html: 4% improvement
&gt; textarea-edit.html: Not affected.

Do you know where we&apos;re spending time in the latter two tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>636987</commentid>
    <comment_count>25</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-05-30 00:57:46 -0700</bug_when>
    <thetext>(In reply to comment #24)
&gt; (In reply to comment #23)
&gt; &gt; Cool!
&gt; &gt; textarea-dom.html: Huge improvement
&gt; &gt; textarea-parsing.html: 4% improvement
&gt; &gt; textarea-edit.html: Not affected.
&gt; 
&gt; Do you know where we&apos;re spending time in the latter two tests?

I haven&apos;t.
Try replacing the textarea in textarea-edit.html with a &lt;div contentEditable=true&gt;.  It&apos;s slightly fastter than the &lt;textarea&gt;, but it&apos;s still very slow.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>143097</attachid>
            <date>2012-05-21 14:30:20 -0700</date>
            <delta_ts>2012-05-21 14:47:41 -0700</delta_ts>
            <desc>Fixes the bug</desc>
            <filename>bug-86813-20120521143356.patch</filename>
            <type>text/plain</type>
            <size>2780</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDExNzgxNSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIyIEBACisyMDEyLTA1LTIxICBSeW9zdWtl
IE5pd2EgIDxybml3YUB3ZWJraXQub3JnPgorCisgICAgICAgIFdlYktpdCBzcGVuZHMgfjIwJSBv
ZiB0aW1lIGluIEhUTUxUZXh0QXJlYUVsZW1lbnQ6OmRlZmF1bHRWYWx1ZSgpIHdoZW4gb3Blbmlu
ZyBhIHJldmlldyBwYWdlCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD04NjgxMworCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisg
ICAgICAgIFJlcGxhY2UgU3RyaW5nIGFuZCBjYWxscyB0byBTdHJpbmc6Om9wZXJhdG9yKz0gYnkg
U3RyaW5nQnVpbGRlciBhbmQgY2FsbHMgdG8gYXBwZW5kIHJlc3BlY3RpdmVseS4KKyAgICAgICAg
V2hpbGUgdGhlcmUgYXJlIG90aGVyIG9wdGltaXphdGlvbnMgd2UgY2FuIGltcGxlbWVudCBzdWNo
IGFzIG5vdCByZXBsYWNpbmcgYWxsIG5vZGVzIGluIHRoZSBzaGFkb3cgRE9NLAorICAgICAgICBv
ciBub3Qgc2VyaWFsaXppbmcgdGhlIHZhbHVlIHdoZW4gZGV0ZWN0aW5nIHdoZXRoZXIgdGhlIHZh
bHVlIGhhZCBjaGFuZ2VkLCB0aGV5IHJlcXVpcmUgY29uc2lkZXJhYmxlCisgICAgICAgIGFtb3Vu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HVlOwog
CiAgICAgLy8gU2luY2UgdGhlcmUgbWF5IGJlIGNvbW1lbnRzLCBpZ25vcmUgbm9kZXMgb3RoZXIg
dGhhbiB0ZXh0IG5vZGVzLgogICAgIGZvciAoTm9kZSogbiA9IGZpcnN0Q2hpbGQoKTsgbjsgbiA9
IG4tPm5leHRTaWJsaW5nKCkpIHsKICAgICAgICAgaWYgKG4tPmlzVGV4dE5vZGUoKSkKLSAgICAg
ICAgICAgIHZhbHVlICs9IHRvVGV4dChuKS0+ZGF0YSgpOworICAgICAgICAgICAgdmFsdWUuYXBw
ZW5kKHRvVGV4dChuKS0+ZGF0YSgpKTsKICAgICB9CiAKLSAgICByZXR1cm4gdmFsdWU7CisgICAg
cmV0dXJuIHZhbHVlLnRvU3RyaW5nKCk7CiB9CiAKIHZvaWQgSFRNTFRleHRBcmVhRWxlbWVudDo6
c2V0RGVmYXVsdFZhbHVlKGNvbnN0IFN0cmluZyYgZGVmYXVsdFZhbHVlKQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>143101</attachid>
            <date>2012-05-21 14:47:49 -0700</date>
            <delta_ts>2012-05-23 01:49:26 -0700</delta_ts>
            <desc>Patch for landing</desc>
            <filename>bug-86813-20120521145125.patch</filename>
            <type>text/plain</type>
            <size>2778</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDExNzgxNSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIyIEBACisyMDEyLTA1LTIxICBSeW9zdWtl
IE5pd2EgIDxybml3YUB3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mV0dXJuIHZhbHVlOworICAgIHJl
dHVybiB2YWx1ZS50b1N0cmluZygpOwogfQogCiB2b2lkIEhUTUxUZXh0QXJlYUVsZW1lbnQ6OnNl
dERlZmF1bHRWYWx1ZShjb25zdCBTdHJpbmcmIGRlZmF1bHRWYWx1ZSkK
</data>

          </attachment>
      

    </bug>

</bugzilla>