Run details:
Mozilla/5.0 (Linux; Android 10; Redmi Note 9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.141 Mobile Safari/537.36
Chrome Mobile 88
Android
Mobile
3 years ago
Test name Executions per second
Vanilla JS .innerText 325349.3 Ops/sec
Vanilla JS .innerHTML 104174.6 Ops/sec
Vanilla JS .textContent 1130193.6 Ops/sec
Vanilla JS (QuerySelector) .innerText 269413.2 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 98847.8 Ops/sec
Vanilla JS (QuerySelector) .textContent 641492.3 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 469569.9 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 481793.2 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 474513.2 Ops/sec
Cash .text 418016.3 Ops/sec
Cash .html 78664.5 Ops/sec
jQuery .text() 153540.0 Ops/sec
jQuery .html() 65009.3 Ops/sec
jQuery .find() .text() 113284.8 Ops/sec
jQuery .find() .html() 52753.6 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()