Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118
Windows
Desktop
one year ago
Test name Executions per second
childNodes foreach 2747737.2 Ops/sec
children (direct) 3142590.0 Ops/sec
firstChild nextSibling 8299933.5 Ops/sec
firstElementChild nextElementChild 18797216.0 Ops/sec
ChildNodes for (into variable) 2857882.0 Ops/sec
children-- (direct) 5277989.5 Ops/sec
ChildNodes for-- (into variable) 2706812.2 Ops/sec
ChildNodes for-- (direct) 4716671.0 Ops/sec
lastElementChild previousElementChild 18575408.0 Ops/sec
children-- (into variable) 8317760.5 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)