Run details:
Mozilla/5.0 (Linux; Android 4.1.2; GT-I8190 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36
Chrome Mobile 56
Android 4.1.2
Samsung GT-I8190
6 years ago
Test name Executions per second
Pure JS .innerText 56953.3 Ops/sec
Pure JS .innerHTML 5995.5 Ops/sec
Pure JS .textContent 102647.6 Ops/sec
jQuery .text() 3434.9 Ops/sec
jQuery .html() 2432.5 Ops/sec
jQuery .find().text() 3933.3 Ops/sec
jQuery .find().html() 2255.0 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()


;