Run details:
Mozilla/5.0 (Linux; Android 8.1.0; MI PLAY) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Mobile Safari/537.36
Chrome Mobile 86
Android 8.1.0
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 149238.0 Ops/sec
Vanilla JS .innerHTML 46043.4 Ops/sec
Vanilla JS .textContent 425740.1 Ops/sec
Vanilla JS (QuerySelector) .innerText 122746.5 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 44571.0 Ops/sec
Vanilla JS (QuerySelector) .textContent 274690.6 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 192774.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 196647.9 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 196188.3 Ops/sec
Cash .text 157082.5 Ops/sec
Cash .html 38147.5 Ops/sec
jQuery .text() 63773.8 Ops/sec
jQuery .html() 30359.6 Ops/sec
jQuery .find() .text() 45521.1 Ops/sec
jQuery .find() .html() 25448.8 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()


;