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
4 years ago
Test name Executions per second
Vanilla JS .innerText 1475463.1 Ops/sec
Vanilla JS .innerHTML 516536.2 Ops/sec
Vanilla JS .textContent 1569323.4 Ops/sec
Vanilla JS (QuerySelector) .innerText 1259812.5 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 499707.2 Ops/sec
Vanilla JS (QuerySelector) .textContent 1234261.5 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 1600170.8 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 1654443.8 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 1632513.8 Ops/sec
Cash .text 674893.4 Ops/sec
Cash .html 289847.8 Ops/sec
jQuery .text() 415793.2 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()