Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Linux
Desktop
7 months ago
Test name Executions per second
childNodes foreach 346449.6 Ops/sec
children (direct) 578208.7 Ops/sec
firstChild nextSibling 2534136.5 Ops/sec
firstElementChild nextElementChild 3987984.2 Ops/sec
ChildNodes for (into variable) 965167.1 Ops/sec
children-- (direct) 973902.7 Ops/sec
ChildNodes for-- (into variable) 502597.1 Ops/sec
ChildNodes for-- (direct) 1241225.9 Ops/sec
lastElementChild previousElementChild 3432073.8 Ops/sec
children-- (into variable) 2056292.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • childNodes foreach

  • children (direct)

  • firstChild nextSibling

  • firstElementChild nextElementChild

  • ChildNodes for (into variable)

  • children-- (direct)

  • ChildNodes for-- (into variable)

  • ChildNodes for-- (direct)

  • lastElementChild previousElementChild

  • children-- (into variable)