Run details:
Mozilla/5.0 (Linux; Android 10; SM-A105FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36
Chrome Mobile 85
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 231581.7 Ops/sec
Vanilla JS .innerHTML 66337.4 Ops/sec
Vanilla JS .textContent 699237.2 Ops/sec
Vanilla JS (QuerySelector) .innerText 186981.8 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 58888.3 Ops/sec
Vanilla JS (QuerySelector) .textContent 410227.6 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 255086.9 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 256776.3 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 248054.2 Ops/sec
Cash .text 256327.6 Ops/sec
Cash .html 43820.1 Ops/sec
jQuery .text() 87692.5 Ops/sec
jQuery .html() 35014.9 Ops/sec
jQuery .find() .text() 63240.7 Ops/sec
jQuery .find() .html() 31023.5 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()