New issue
Advanced search Search tips

Issue 900098 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

appending to innerText is very slow in debug builds

Project Member Reported by fergal@chromium.org, Oct 30

Issue description

Loading this snippet of HTML in content shell takes 15s on my workstation.

<div id="e">
</div>
<script>
  let start = Date.now();
  console.log("here");
  for (i=0; i< 200; i++) {
      e.innerText += "AXRole: AXColumnHeader col head\n";
  }
  console.log("here");
  console.log(Date.now()-start);
</script>

- Removing the \n drops it to 4s which is still very slow.
- Switching to e.textContent makes it take 38ms which seems much closer to what I would expect.

yosin@ tells me that getting .innerText causes a full layout but thinks maybe we really only need to recalc style.

I dug into this because of  http://crbug.com/898049  .
 
Note: 
* innerText getter causes style and layout update.
* innerText setter changes "\n" to <br>
Components: -Blink>DOM Blink>HTML
FYI. innerText is defined here: https://html.spec.whatwg.org/#dom-innertext
This occurs with Debug builds but not release builds. I imagine some validation or something is slowing things down. I am going to make a change to the test that is slow and flaky so that it doesn't hit this problem but it unclear that fixing the root cause is important.
Summary: appending to innerText is very slow in debug builds (was: appending to innerText is very slow)
Components: -Blink>HTML -Blink>Layout Blink>Editing>Serialization
Labels: -Type-Bug Type-Task
Status: Available (was: Untriaged)

Sign in to add a comment