Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0
Firefox 119
Linux
Desktop
10 months ago
Test name Executions per second
childNodes foreach 3375416.8 Ops/sec
children (direct) 5613930.5 Ops/sec
firstChild nextSibling 22137484.0 Ops/sec
firstElementChild nextElementChild 48043380.0 Ops/sec
ChildNodes for (into variable) 4171763.2 Ops/sec
children-- (direct) 8896792.0 Ops/sec
ChildNodes for-- (into variable) 5037688.0 Ops/sec
ChildNodes for-- (direct) 6044883.5 Ops/sec
lastElementChild previousElementChild 45576992.0 Ops/sec
children-- (into variable) 11370601.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)