Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:76.0) Gecko/20100101 Firefox/76.0
Firefox 76
Mac OS X 10.12
Desktop
4 years ago
Test name Executions per second
Vanilla JS .innerText 610617.3 Ops/sec
Vanilla JS .innerHTML 1029652.5 Ops/sec
Vanilla JS .textContent 1117520.2 Ops/sec
Vanilla JS (QuerySelector) .innerText 562031.6 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 846503.9 Ops/sec
Vanilla JS (QuerySelector) .textContent 979257.1 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 366153.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 344841.2 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 238778.9 Ops/sec
Cash .text 877251.3 Ops/sec
Cash .html 864660.7 Ops/sec
jQuery .text() 501837.7 Ops/sec
jQuery .html() 448319.0 Ops/sec
jQuery .find() .text() 169413.7 Ops/sec
jQuery .find() .html() 164745.6 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()


;