Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Chrome 96
Windows
Desktop
2 years ago
Test name Executions per second
Pure JS .innerText 311268.6 Ops/sec
Pure JS .innerHTML 171288.6 Ops/sec
Pure JS .textContent 2171970.0 Ops/sec
jQuery .text() 150708.9 Ops/sec
jQuery .html() 105690.1 Ops/sec
jQuery .find() 125711.8 Ops/sec
jQuery .find().html() 99833.9 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find()

  • jQuery .find().html()


;