Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
Firefox 77
Windows
Desktop
4 years ago
Test name Executions per second
Vanilla JS .innerText 739675.9 Ops/sec
Vanilla JS .innerHTML 986938.7 Ops/sec
Vanilla JS .textContent 1039123.4 Ops/sec
Vanilla JS (QuerySelector) .innerText 672567.1 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 904401.6 Ops/sec
Vanilla JS (QuerySelector) .textContent 928390.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 311994.0 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 263449.0 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 233831.4 Ops/sec
Cash .text 1072403.6 Ops/sec
Cash .html 1038628.0 Ops/sec
jQuery .text() 675999.7 Ops/sec
jQuery .html() 664236.2 Ops/sec
jQuery .find() .text() 357013.4 Ops/sec
jQuery .find() .html() 352283.8 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()


;