Run details:
Mozilla/5.0 (Linux; Android 7.1.1; SM-J510F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36
Chrome Mobile 74
Android 7.1.1
Mobile
5 years ago
Test name Executions per second
Pure JS .innerText 96705.6 Ops/sec
Pure JS .innerHTML 18933.3 Ops/sec
Pure JS .textContent 250368.1 Ops/sec
jQuery .text() 39941.2 Ops/sec
jQuery .html() 10807.9 Ops/sec
jQuery .find().text() 29578.5 Ops/sec
jQuery .find().html() 9070.0 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()


;