Run details:
Mozilla/5.0 (Linux; Android 10; MAR-LX1A Build/HUAWEIMAR-L21A; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.93 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/302.0.0.45.119;]
Chrome Mobile 88
Android
Mobile
3 years ago
Test name Executions per second
Vanilla JS .innerText 324780.7 Ops/sec
Vanilla JS .innerHTML 97655.2 Ops/sec
Vanilla JS .textContent 942554.5 Ops/sec
Vanilla JS (QuerySelector) .innerText 271309.7 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 88201.9 Ops/sec
Vanilla JS (QuerySelector) .textContent 600030.5 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 333039.5 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 333282.2 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 333163.1 Ops/sec
Cash .text 332670.0 Ops/sec
Cash .html 71884.6 Ops/sec
jQuery .text() 129476.7 Ops/sec
jQuery .html() 54229.1 Ops/sec
jQuery .find() .text() 93006.2 Ops/sec
jQuery .find() .html() 45354.2 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()


;