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()

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    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()

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Firefox 88 on Windows
View result in a separate tab
Test name Executions per second
Vanilla JS .innerText 1464368.0 Ops/sec
Vanilla JS .innerHTML 3806404.0 Ops/sec
Vanilla JS .textContent 3235134.0 Ops/sec
Vanilla JS (querySelector) .innerText 1006010.0 Ops/sec
Vanilla JS (querySelector) .innerHTML 2017142.0 Ops/sec
Vanilla JS (querySelector) .textContent 2202546.0 Ops/sec
Vanilla JS (querySelectorAll) .innerText 747961.2 Ops/sec
Vanilla JS (querySelectorAll) .innerHTML 775694.1 Ops/sec
Vanilla JS (querySelectorAll) .textContent 793841.7 Ops/sec
Cash .text 3323880.0 Ops/sec
Cash .html 2048757.0 Ops/sec
jQuery .text() 1714825.0 Ops/sec
jQuery .html() 1681616.0 Ops/sec
jQuery .find() .text() 513251.9 Ops/sec
jQuery .find() .html() 491278.2 Ops/sec