Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Windows
Desktop
10 months ago
Test name Executions per second
set same value via textContent 5381901.0 Ops/sec
set same value via innerText 2107467.0 Ops/sec
set different value via textContext 5284823.5 Ops/sec
set different value via innerText 2002470.8 Ops/sec
set same value if changed via textContent 6310752.0 Ops/sec
set same value if changed via innerText 741196.3 Ops/sec
set different value if changed via textContent 6412946.0 Ops/sec
set different value if changed via innerText 768760.8 Ops/sec
set same value via nodeValue 5197953.5 Ops/sec
set different value via nodeValue 4233529.0 Ops/sec
set same value if changed via nodeValue 8648134.0 Ops/sec
set different value if changed via nodeValue 8498622.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • set same value via textContent

  • set same value via innerText

  • set different value via textContext

  • set different value via innerText

  • set same value if changed via textContent

  • set same value if changed via innerText

  • set different value if changed via textContent

  • set different value if changed via innerText

  • set same value via nodeValue

  • set different value via nodeValue

  • set same value if changed via nodeValue

  • set different value if changed via nodeValue