Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
fastest iter childelements 3205703.8 Ops/sec
tag name 2338569.8 Ops/sec
class name 2243794.5 Ops/sec
id 1849928.5 Ops/sec
array of node 2239250.8 Ops/sec
array item 5104831.0 Ops/sec
fastest iter childelements + getAttribute 6069230.0 Ops/sec
fastest iter childelements + nodeValue 13474736.0 Ops/sec
fastest iter childelements + textContent 5507826.5 Ops/sec
fastest iter childelements + getAttributeNode 4369311.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • fastest iter childelements

  • tag name

  • class name

  • id

  • array of node

  • array item

  • fastest iter childelements + getAttribute

  • fastest iter childelements + nodeValue

  • fastest iter childelements + textContent

  • fastest iter childelements + getAttributeNode