Run details:
Mozilla/5.0 (Linux; Android 8.1.0; CPH1803) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Mobile Safari/537.36
Chrome Mobile 86
Android 8.1.0
Mobile
3 years ago
Test name Executions per second
Vanilla JS .innerText 120267.4 Ops/sec
Vanilla JS .innerHTML 39046.7 Ops/sec
Vanilla JS .textContent 315087.0 Ops/sec
Vanilla JS (QuerySelector) .innerText 100397.2 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 34702.3 Ops/sec
Vanilla JS (QuerySelector) .textContent 216128.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 149057.6 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 150421.4 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 149611.9 Ops/sec
Cash .text 115440.6 Ops/sec
Cash .html 29077.4 Ops/sec
jQuery .text() 47914.5 Ops/sec
jQuery .html() 23559.1 Ops/sec
jQuery .find() .text() 34921.9 Ops/sec
jQuery .find() .html() 20408.9 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()


;