Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4158.4 Safari/537.36
Chrome 85
Windows 7
Desktop
4 years ago
Test name Executions per second
createTextNode 390119.6 Ops/sec
textContent 2196028.2 Ops/sec
innerText 600419.2 Ops/sec
innerHTML 84730.7 Ops/sec
Script Preparation code:
AخA
 
var a = document.createElement('a');
Tests:
  • createTextNode

     
    a.appendChild(document.createTextNode('text'));
  • textContent

     
    a.textContent = 'text';
  • innerText

     
    a.innerText = 'text';
  • innerHTML

     
    a.innerHTML = 'text';