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: 3 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Chrome 102 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Vanilla JS .innerText 792177.7 Ops/sec
Vanilla JS .innerHTML 285243.1 Ops/sec
Vanilla JS .textContent 1736911.0 Ops/sec
Vanilla JS (QuerySelector) .innerText 580744.5 Ops/sec
Vanilla JS (QuerySelector) .innerHTML 235414.3 Ops/sec
Vanilla JS (QuerySelector) .textContent 1028980.0 Ops/sec
Vanilla JS (QuerySelectorAll) .innerText 615940.2 Ops/sec
Vanilla JS (QuerySelectorAll) .innerHTML 637465.3 Ops/sec
Vanilla JS (QuerySelectorAll) .textContent 638463.6 Ops/sec
Cash .text 903160.7 Ops/sec
Cash .html 206983.7 Ops/sec
jQuery .text() 314295.2 Ops/sec
jQuery .html() 160892.6 Ops/sec
jQuery .find() .text() 241821.6 Ops/sec
jQuery .find() .html() 139200.9 Ops/sec