textContent vs createTextNode() vs innerHTML (v6)

Revision 6 of this benchmark created on


Preparation HTML

<div id="div">
  asdfghkkl
</div>

Setup

var div = document.getElementById('div');

Test runner

Ready to run.

Testing in
TestOps/sec
innerText
div.innerText = Math.random();
ready
createTextNode()
div.removeChild(div.firstChild);
div.appendChild(document.createTextNode(Math.random()));
ready
innerHTML
div.innerHTML = Math.random();
ready

Revisions

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