Run details:
Mozilla/5.0 (Linux; U; Android 9; en-US; Redmi Note 5 Build/PKQ1.180904.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.12.0.1187 Mobile Safari/537.36
UC Browser 12
Android
Mobile
5 years ago
Test name Executions per second
Pure JS .innerText 543179.4 Ops/sec
Pure JS .innerHTML 33070.7 Ops/sec
Pure JS .textContent 724405.6 Ops/sec
jQuery .text() 122234.4 Ops/sec
jQuery .html() 21787.1 Ops/sec
jQuery .find().text() 77812.1 Ops/sec
jQuery .find().html() 18372.6 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()