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 1755339.5 Ops/sec
tag name 1257300.0 Ops/sec
class name 1254019.4 Ops/sec
id 854707.5 Ops/sec
array of node 1139039.0 Ops/sec
array item 2944595.0 Ops/sec
fastest iter childelements + getAttribute 3415454.5 Ops/sec
fastest iter childelements + nodeValue 7899743.5 Ops/sec
fastest iter childelements + textContent 2654045.0 Ops/sec
fastest iter childelements + getAttributeNode 2316098.8 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