Append Text Node vs. innerHTML (plain Text only)

Benchmark created on


Description

There's lots of tests of innerHTML vs appendChild stuff around but I want to test this only for plain text, no HTML.

Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
innerHTML
var elem = document.body.appendChild(document.createElement("div"));
elem.innerHTML = "Just some plain text.";
document.body.removeChild(elem);
ready
text node
var elem = document.body.appendChild(document.createElement("div"));
elem.appendChild(document.createTextNode("Just some plain text."));
document.body.removeChild(elem);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.