[Webkit-unassigned] [Bug 110786] New: Performance issues adding large numbers of whitespace text nodes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 25 12:59:05 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=110786

           Summary: Performance issues adding large numbers of whitespace
                    text nodes
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: webkit at blois.us


Created an attachment (id=190110)
 --> (https://bugs.webkit.org/attachment.cgi?id=190110&action=review)
HTML repro file

When a large number of whitespace text nodes are added to the document, interspersed with standard div elements, WebKit spends an excessive amount of time in 'Recalculate Style'.

To reproduce, load the following HTML in a page:
<!DOCTYPE html>
<html>
<body>
  <script>
for (var i = 0; i < 1500; ++i) {
  document.body.appendChild(document.createTextNode(' '));
  document.body.appendChild(document.createElement('div'));
  document.body.appendChild(document.createTextNode(' '));
}
  </script>
</body>
</html>

Expected:
Page loads in <300ms.

Actual:
Page loads in 20-30s, majority of time attributed by timeline to 'Recalculate Style'.

Does not repro on FireFox and IE 9/10.
Does not repro if any non-whitespace characters are added to the text nodes.
Does not repro if spans of whitespace are inserted rather than text nodes.

Also repros with document fragments:
var fragment = document.createDocumentFragment();
fragment.appendChild(document.createTextNode(' '));
fragment.appendChild(document.createElement('div'));
fragment.appendChild(document.createTextNode(' '));
for (var i = 0; i < 1500; ++i) {
  document.body.appendChild(fragment.cloneNode(true));
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list