Run details:
Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36
Chrome Mobile 74
Android 8.0.0
Mobile
5 years ago
Test name Executions per second
Pure JS .innerText 40134.3 Ops/sec
Pure JS .innerHTML 13005.1 Ops/sec
Pure JS .textContent 178572.1 Ops/sec
jQuery .text() 18170.1 Ops/sec
jQuery .html() 9294.3 Ops/sec
jQuery .find().text() 13998.4 Ops/sec
jQuery .find().html() 7148.4 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()


;