Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Chrome 91
Linux
Desktop
3 years ago
Test name Executions per second
createTextNode 1265293.0 Ops/sec
textContent 746.6 Ops/sec
innerText 794162.1 Ops/sec
innerHTML 38415.1 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';