[webkit-help] What about WebKit makes DOM insertion slow when your template has whitespace / text nodes?

Steven Luscher webkit at steveluscher.com
Wed May 8 09:48:03 PDT 2013


Hello WebKit team,

I've been able to replicate some strange behavior on Chrome 26 (Mac) and Safari 6.0.4 (Mac). Essentially, rendering an HTML template that has extra whitespace / text-nodes in it is incredibly slow.Rendering the same template with the whitespace stripped results in a 400x speedup.

Here's a detailed explanation of the bug:
http://stackoverflow.com/questions/16428987/what-about-webkit-makes-dom-insertion-slow-when-your-template-has-whitespace-t

And here's a JSFiddle demonstrating it:
http://jsfiddle.net/cEK2x/2/

Any idea what about WebKit causes this? Firefox 26, IE9, and Chrome Canary don't exhibit the bug.

Cheers,
Steven…


More information about the webkit-help mailing list