textContent vs createTextNode() vs innerHTML (v8)

Revision 8 of this benchmark created by Zibx on


Preparation HTML

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

Setup

var div = document.getElementById( 'div' ), doc = document,c=10000000000,textNode = div.childNodes[0];

Test runner

Ready to run.

Testing in
TestOps/sec
innerText
div.innerText= c++;
 
ready
textContent
textNode.textContent = c++;
 
ready
innerHTML
div.innerHTML = c++;
 
ready

Revisions

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