Run details:
Mozilla/5.0 (Linux; Android 5.0.2; Redmi Note 3 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Mobile Safari/537.36
Chrome Mobile 60
Android 5.0.2
Redmi Note 3
7 years ago
Test name Executions per second
Pure JS .innerText 123897.7 Ops/sec
Pure JS .innerHTML 26674.3 Ops/sec
Pure JS .textContent 298747.4 Ops/sec
jQuery .text() 32535.3 Ops/sec
jQuery .html() 16996.3 Ops/sec
jQuery .find().text() 29280.8 Ops/sec
jQuery .find().html() 14374.3 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()