Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Chrome 87
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
Remove firstChild 2519169.0 Ops/sec
Remove lastChild 2506535.0 Ops/sec
innerHTML 2066155.9 Ops/sec
innerText 1708757.6 Ops/sec
textContent 2035806.1 Ops/sec
firstChild.remove 2614710.8 Ops/sec
range 483180.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Remove firstChild

  • Remove lastChild

  • innerHTML

  • innerText

  • textContent

  • firstChild.remove

  • range