Run details:
Mozilla/5.0 (Linux; Android 10; SM-M205G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.185 Mobile Safari/537.36
Chrome Mobile 86
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 253738.1 Ops/sec
Vanilla JS .innerHTML 72361.8 Ops/sec
Vanilla JS .textContent 799222.9 Ops/sec
Vanilla JS (QuerySelector) .innerText 203624.3 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 65258.5 Ops/sec
Vanilla JS (QuerySelector) .textContent 465569.6 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 298754.5 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 297227.5 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 293530.0 Ops/sec
Cash .text 268109.2 Ops/sec
Cash .html 56503.7 Ops/sec
jQuery .text() 107417.6 Ops/sec
jQuery .html() 45155.5 Ops/sec
jQuery .find() .text() 74656.1 Ops/sec
jQuery .find() .html() 34192.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()