Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/67.0.3396.87 Mobile/15E216 Safari/604.1
Chrome Mobile iOS 67
iOS 11.3
Mobile
5 years ago
Test name Executions per second
Pure JS .innerText 760387.8 Ops/sec
Pure JS .innerHTML 196309.8 Ops/sec
Pure JS .textContent 941853.4 Ops/sec
jQuery .text() 152987.0 Ops/sec
jQuery .html() 34110.5 Ops/sec
jQuery .find().text() 129092.2 Ops/sec
jQuery .find().html() 92053.2 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()