Run details:
Mozilla/5.0 (Linux; Android 10; Redmi Note 9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 359143.1 Ops/sec
Vanilla JS .innerHTML 108759.2 Ops/sec
Vanilla JS .textContent 1204439.8 Ops/sec
Vanilla JS (QuerySelector) .innerText 307486.8 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 102597.9 Ops/sec
Vanilla JS (QuerySelector) .textContent 793613.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 501235.3 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 478579.3 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 509872.0 Ops/sec
Cash .text 420710.7 Ops/sec
Cash .html 80170.7 Ops/sec
jQuery .text() 154324.6 Ops/sec
jQuery .html() 64227.8 Ops/sec
jQuery .find() .text() 80003.5 Ops/sec
jQuery .find() .html() 18029.1 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()


;