Run details:
Mozilla/5.0 (Linux; U; Android 4.1.2; pt-pt; GT-I8190 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Android 4
Android 4.1.2
Samsung GT-I8190
6 years ago
Test name Executions per second
Pure JS .innerText 117334.0 Ops/sec
Pure JS .innerHTML 22002.7 Ops/sec
Pure JS .textContent 3846.1 Ops/sec
jQuery .text() 1375.7 Ops/sec
jQuery .html() 2581.4 Ops/sec
jQuery .find().text() 2979.4 Ops/sec
jQuery .find().html() 3912.8 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()