Run details:
Mozilla/5.0 (Linux; Android 10; POCO F2 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.101 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 533519.9 Ops/sec
Vanilla JS .innerHTML 175188.1 Ops/sec
Vanilla JS .textContent 1688125.5 Ops/sec
Vanilla JS (QuerySelector) .innerText 461376.6 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 167039.2 Ops/sec
Vanilla JS (QuerySelector) .textContent 1167785.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 646222.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 648676.5 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 652751.2 Ops/sec
Cash .text 631665.6 Ops/sec
Cash .html 131594.0 Ops/sec
jQuery .text() 266524.2 Ops/sec
jQuery .html() 110390.8 Ops/sec
jQuery .find() .text() 195024.3 Ops/sec
jQuery .find() .html() 87480.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()