Run details:
Mozilla/5.0 (Linux; Android 10; MAR-LX1M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Mobile Safari/537.36
Chrome Mobile 84
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 357628.8 Ops/sec
Vanilla JS .innerHTML 102329.9 Ops/sec
Vanilla JS .textContent 1085908.4 Ops/sec
Vanilla JS (QuerySelector) .innerText 295052.4 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 91885.3 Ops/sec
Vanilla JS (QuerySelector) .textContent 677162.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 406097.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 408813.5 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 411415.7 Ops/sec
Cash .text 372635.3 Ops/sec
Cash .html 77485.1 Ops/sec
jQuery .text() 150917.8 Ops/sec
jQuery .html() 61630.1 Ops/sec
jQuery .find() .text() 107090.0 Ops/sec
jQuery .find() .html() 48699.7 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()