Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Chrome 61
Linux
Other
7 years ago
Test name Executions per second
Pure JS .innerText 1128393.4 Ops/sec
Pure JS .innerHTML 2262955.5 Ops/sec
Pure JS .textContent 3606014.0 Ops/sec
jQuery .text() 1210431.9 Ops/sec
jQuery .html() 1024070.5 Ops/sec
jQuery .find().text() 760019.6 Ops/sec
jQuery .find().html() 684494.5 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()


;