Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
fastest iter childelements 1586874.2 Ops/sec
tag name 1239196.5 Ops/sec
class name 1174284.4 Ops/sec
id 869234.8 Ops/sec
array of node 1026156.4 Ops/sec
array item 2436694.2 Ops/sec
fastest iter childelements + getAttribute 2937492.0 Ops/sec
fastest iter childelements + nodeValue 6462625.5 Ops/sec
fastest iter childelements + textContent 2299594.0 Ops/sec
fastest iter childelements + getAttributeNode 2092940.4 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