Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36
Chrome 60
Mac OS X 10.9.5
Other
7 years ago
Test name Executions per second
Pure JS .innerText 212361.1 Ops/sec
Pure JS .innerHTML 744587.8 Ops/sec
Pure JS .textContent 1365297.2 Ops/sec
jQuery .text() 238587.9 Ops/sec
jQuery .html() 189911.9 Ops/sec
jQuery .find().text() 157999.0 Ops/sec
jQuery .find().html() 135290.9 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()


;