Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Firefox 114
Windows
Desktop
one year ago
Test name Executions per second
createTextNode 1397677.4 Ops/sec
textContent 3240991.8 Ops/sec
innerText 2277157.8 Ops/sec
innerHTML 3624357.2 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';