Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:75.0) Gecko/20100101 Firefox/75.0
Firefox 75
Mac OS X 10.14
Desktop
4 years ago
Test name Executions per second
Vanilla JS .innerText 266191.7 Ops/sec
Vanilla JS .innerHTML 419202.7 Ops/sec
Vanilla JS .textContent 405337.5 Ops/sec
Vanilla JS (QuerySelector) .innerText 250045.4 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 375405.4 Ops/sec
Vanilla JS (QuerySelector) .textContent 369279.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 166871.9 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 173400.7 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 108309.0 Ops/sec
Cash .text 379458.5 Ops/sec
Cash .html 416554.4 Ops/sec
jQuery .text() 232018.5 Ops/sec
jQuery .html() 182295.7 Ops/sec
jQuery .find() .text() 92732.4 Ops/sec
jQuery .find() .html() 84369.4 Ops/sec
HTML Preparation code:
Tests:
  • Vanilla JS .innerText

  • Vanilla JS .innerHTML

  • Vanilla JS .textContent

  • Vanilla JS (QuerySelector) .innerText

  • Vanilla JS (QuerySelector) .innerHTML

  • Vanilla JS (QuerySelector) .textContent

  • Vanilla JS (QuerySelectorAll) .innerText

  • Vanilla JS (QuerySelectorAll) .innerHTML

  • Vanilla JS (QuerySelectorAll) .textContent

  • Cash .text

  • Cash .html

  • jQuery .text()

  • jQuery .html()

  • jQuery .find() .text()

  • jQuery .find() .html()