Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Firefox 135
Windows
Desktop
12 days ago
Test name Executions per second
createTextNode 652014.8 Ops/sec
textContent 1177320.0 Ops/sec
innerText 687323.9 Ops/sec
append 1255781.6 Ops/sec
new text 896564.6 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';
  • append

     
    a.append('text');
  • new text

     
    a.appendChild(new Text('text'));