appending to innerText is very slow in debug builds |
||||
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 .
,
Oct 30
FYI. innerText is defined here: https://html.spec.whatwg.org/#dom-innertext
,
Oct 30
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.
,
Oct 30
,
Nov 5
|
||||
►
Sign in to add a comment |
||||
Comment 1 by yosin@chromium.org
, Oct 30