Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/83.0.4103.88 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 83
iOS 13.5
Mobile
3 years ago
Test name Executions per second
Vanilla JS .innerText 1475463.0 Ops/sec
Vanilla JS .innerHTML 516536.2 Ops/sec
Vanilla JS .textContent 1569323.0 Ops/sec
Vanilla JS (QuerySelector) .innerText 1259813.0 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 499707.3 Ops/sec
Vanilla JS (QuerySelector) .textContent 1234262.0 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 1600171.0 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 1654444.0 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 1632514.0 Ops/sec
Cash .text 674893.4 Ops/sec
Cash .html 289847.8 Ops/sec
jQuery .text() 415793.3 Ops/sec
jQuery .html() 269846.0 Ops/sec
jQuery .find() .text() 340388.9 Ops/sec
jQuery .find() .html() 210009.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()