Run details:
Mozilla/5.0 (Linux; Android 10; Redmi Note 9S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Mobile Safari/537.36
Chrome Mobile 89
Android
Mobile
3 years ago
Test name Executions per second
Vanilla JS .innerText 328365.2 Ops/sec
Vanilla JS .innerHTML 102247.2 Ops/sec
Vanilla JS .textContent 961816.6 Ops/sec
Vanilla JS (QuerySelector) .innerText 293432.2 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 99393.0 Ops/sec
Vanilla JS (QuerySelector) .textContent 714127.1 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 449882.7 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 448055.9 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 447192.5 Ops/sec
Cash .text 607720.9 Ops/sec
Cash .html 85803.2 Ops/sec
jQuery .text() 178608.2 Ops/sec
jQuery .html() 68154.7 Ops/sec
jQuery .find() .text() 129931.4 Ops/sec
jQuery .find() .html() 55306.2 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()