Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
Mobile Safari 11
iOS 11.3
iPhone
5 years ago
Test name Executions per second
Pure JS .innerText 1093981.0 Ops/sec
Pure JS .innerHTML 276785.5 Ops/sec
Pure JS .textContent 1125044.0 Ops/sec
jQuery .text() 240182.0 Ops/sec
jQuery .html() 131354.6 Ops/sec
jQuery .find().text() 187841.8 Ops/sec
jQuery .find().html() 114326.3 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()