Run details:
Mozilla/5.0 (Linux; Android 10; ZenFone Max Pro M1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Mobile Safari/537.36
Chrome Mobile 84
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 102872.8 Ops/sec
Vanilla JS .innerHTML 50358.7 Ops/sec
Vanilla JS .textContent 886198.2 Ops/sec
Vanilla JS (QuerySelector) .innerText 87239.8 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 44265.8 Ops/sec
Vanilla JS (QuerySelector) .textContent 567737.0 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 321026.9 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 348431.2 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 350389.4 Ops/sec
Cash .text 301325.2 Ops/sec
Cash .html 34624.3 Ops/sec
jQuery .text() 55458.9 Ops/sec
jQuery .html() 29462.7 Ops/sec
jQuery .find() .text() 43617.2 Ops/sec
jQuery .find() .html() 25830.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()


;