Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_3 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) CriOS/61.0.3163.73 Mobile/15A432 Safari/602.1
Chrome Mobile iOS 61
iOS 11.0.3
iPhone
7 years ago
Test name Executions per second
Pure JS .innerText 619032.3 Ops/sec
Pure JS .innerHTML 170216.4 Ops/sec
Pure JS .textContent 647052.9 Ops/sec
jQuery .text() 142946.5 Ops/sec
jQuery .html() 75877.7 Ops/sec
jQuery .find().text() 108861.4 Ops/sec
jQuery .find().html() 62945.9 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()