Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1
Mobile Safari 13
iOS 13.0
Mobile
5 years ago
Test name Executions per second
Pure JS .innerText 1489812.6 Ops/sec
Pure JS .innerHTML 364804.2 Ops/sec
Pure JS .textContent 1348939.9 Ops/sec
jQuery .text() 409788.6 Ops/sec
jQuery .html() 180999.3 Ops/sec
jQuery .find().text() 245292.8 Ops/sec
jQuery .find().html() 137859.1 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()