Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36
Chrome 87
Linux
Desktop
3 years ago
Test name Executions per second
Vanilla JS .innerText 47481.5 Ops/sec
Vanilla JS .innerHTML 18771.7 Ops/sec
Vanilla JS .textContent 287832.8 Ops/sec
Vanilla JS (QuerySelector) .innerText 75027.4 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 24961.2 Ops/sec
Vanilla JS (QuerySelector) .textContent 197890.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 113128.5 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 124254.1 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 119598.2 Ops/sec
Cash .text 150730.2 Ops/sec
Cash .html 20548.0 Ops/sec
jQuery .text() 38533.6 Ops/sec
jQuery .html() 17831.2 Ops/sec
jQuery .find() .text() 19387.4 Ops/sec
jQuery .find() .html() 6408.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()


;