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 2740318.8 Ops/sec
children (direct) 3055613.5 Ops/sec
firstChild nextSibling 8186186.5 Ops/sec
firstElementChild nextElementChild 18687898.0 Ops/sec
ChildNodes for (into variable) 2826883.8 Ops/sec
children-- (direct) 5238523.5 Ops/sec
ChildNodes for-- (into variable) 2682539.8 Ops/sec
ChildNodes for-- (direct) 4682931.0 Ops/sec
lastElementChild previousElementChild 18439090.0 Ops/sec
children-- (into variable) 8234518.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)