Run details:
Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/49.0.2623.108 Mobile Safari/537.36
Chrome Mobile 49
Android 5.0
ASUS_Z00AD
6 years ago
Test name Executions per second
Pure JS .innerText 124565.8 Ops/sec
Pure JS .innerHTML 31481.4 Ops/sec
Pure JS .textContent 311784.7 Ops/sec
jQuery .text() 16446.0 Ops/sec
jQuery .html() 15631.6 Ops/sec
jQuery .find().text() 13251.3 Ops/sec
jQuery .find().html() 13265.2 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()