Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36
Chrome 95
Linux
Desktop
3 years ago
Test name Executions per second
fastest iter childelements 1316210.6 Ops/sec
tag name 828149.6 Ops/sec
class name 858032.3 Ops/sec
id 616016.1 Ops/sec
array of node 836004.6 Ops/sec
array item 2206713.0 Ops/sec
fastest iter childelements + getAttribute 2159394.0 Ops/sec
fastest iter childelements + nodeValue 7058151.5 Ops/sec
fastest iter childelements + textContent 2399057.2 Ops/sec
fastest iter childelements + getAttributeNode 1684552.4 Ops/sec
tag name-- 915715.4 Ops/sec
class name-- 900000.0 Ops/sec
queryselectorall class-- 658490.4 Ops/sec
queryselectorall tag-- 639069.8 Ops/sec
array item-- 3912033.0 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

  • tag name--

  • class name--

  • queryselectorall class--

  • queryselectorall tag--

  • array item--