Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Windows
Desktop
2 years ago
Test name Executions per second
childNodes foreach 1269794.9 Ops/sec
children (direct) 848333.3 Ops/sec
firstChild nextSibling 2104329.8 Ops/sec
firstElementChild nextElementChild 7799812.5 Ops/sec
ChildNodes for (into variable) 505550.8 Ops/sec
children-- (direct) 818144.7 Ops/sec
ChildNodes for-- (into variable) 533667.2 Ops/sec
ChildNodes for-- (direct) 1595497.9 Ops/sec
lastElementChild previousElementChild 6522237.5 Ops/sec
children-- (into variable) 1863810.8 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)