Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
innerHTML 1541849.6 Ops/sec
replaceChildren 1192974.1 Ops/sec
remove firstChild 1684805.9 Ops/sec
remove lastChild 1673064.4 Ops/sec
textContent 1525804.2 Ops/sec
remove and recreate root element 238933.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • innerHTML

  • replaceChildren

  • remove firstChild

  • remove lastChild

  • textContent

  • remove and recreate root element