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: 8 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106 on Windows
View result in a separate tab
Test name Executions per second
Vanilla JS .innerText 2403249.0 Ops/sec
Vanilla JS .innerHTML 6052509.0 Ops/sec
Vanilla JS .textContent 6097351.0 Ops/sec
Vanilla JS (querySelector) .innerText 1848597.0 Ops/sec
Vanilla JS (querySelector) .innerHTML 3653835.0 Ops/sec
Vanilla JS (querySelector) .textContent 3671761.0 Ops/sec
Vanilla JS (querySelectorAll) .innerText 1146966.0 Ops/sec
Vanilla JS (querySelectorAll) .innerHTML 1295210.0 Ops/sec
Vanilla JS (querySelectorAll) .textContent 1370493.0 Ops/sec
Cash .text 5085200.0 Ops/sec
Cash .html 3310899.0 Ops/sec
jQuery .text() 2858575.0 Ops/sec
jQuery .html() 2742345.0 Ops/sec
jQuery .find() .text() 1189871.0 Ops/sec
jQuery .find() .html() 1190931.0 Ops/sec