Run details:
Mozilla/5.0 (Linux; Android 6.0; A70) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36 OPR/54.3.2672.50220
Opera Mobile 54
Android 6.0
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 63305.6 Ops/sec
Vanilla JS .innerHTML 11484.7 Ops/sec
Vanilla JS .textContent 178699.9 Ops/sec
Vanilla JS (QuerySelector) .innerText 56391.8 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 11506.6 Ops/sec
Vanilla JS (QuerySelector) .textContent 113798.4 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 69763.4 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 62635.8 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 58111.5 Ops/sec
Cash .text 71679.3 Ops/sec
Cash .html 10256.7 Ops/sec
jQuery .text() 15942.3 Ops/sec
jQuery .html() 7169.6 Ops/sec
jQuery .find() .text() 13806.3 Ops/sec
jQuery .find() .html() 5641.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()