Run details:
Mozilla/5.0 (iPad; CPU OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/11.1b10377 Mobile/15E302 Safari/605.1.15
Mobile Safari 11
iOS 11.3
Tablet
6 years ago
Test name Executions per second
Pure JS .innerText 673420.3 Ops/sec
Pure JS .innerHTML 177414.3 Ops/sec
Pure JS .textContent 674221.7 Ops/sec
jQuery .text() 204979.8 Ops/sec
jQuery .html() 104654.2 Ops/sec
jQuery .find().text() 152792.2 Ops/sec
jQuery .find().html() 87806.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()


;