Run details:
Mozilla/5.0 (Linux; Android 10; POCOPHONE F1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.114 Mobile Safari/537.36
Chrome Mobile 86
Android
Mobile
4 years ago
Test name Executions per second
Vanilla JS .innerText 442182.3 Ops/sec
Vanilla JS .innerHTML 136575.1 Ops/sec
Vanilla JS .textContent 1511749.4 Ops/sec
Vanilla JS (QuerySelector) .innerText 332211.9 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 123332.0 Ops/sec
Vanilla JS (QuerySelector) .textContent 839217.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 501507.3 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 482007.0 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 488137.5 Ops/sec
Cash .text 532857.9 Ops/sec
Cash .html 90558.4 Ops/sec
jQuery .text() 189087.3 Ops/sec
jQuery .html() 74662.7 Ops/sec
jQuery .find() .text() 137855.3 Ops/sec
jQuery .find() .html() 62234.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()