Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
Firefox 75
Windows
Desktop
4 years ago
Test name Executions per second
Vanilla JS .innerText 703034.9 Ops/sec
Vanilla JS .innerHTML 1032290.2 Ops/sec
Vanilla JS .textContent 1089746.0 Ops/sec
Vanilla JS (QuerySelector) .innerText 564689.8 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 795343.4 Ops/sec
Vanilla JS (QuerySelector) .textContent 801459.9 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 406553.7 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 292683.2 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 267371.4 Ops/sec
Cash .text 969630.5 Ops/sec
Cash .html 880548.4 Ops/sec
jQuery .text() 594096.9 Ops/sec
jQuery .html() 619528.8 Ops/sec
jQuery .find() .text() 332397.4 Ops/sec
jQuery .find() .html() 322463.1 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()


;