Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106
Linux
Desktop
2 years ago
Test name Executions per second
childNodes foreach 2000808.1 Ops/sec
children (direct) 2212957.0 Ops/sec
firstChild nextSibling 4333810.0 Ops/sec
firstElementChild nextElementChild 14189806.0 Ops/sec
ChildNodes for (into variable) 1925387.8 Ops/sec
children-- (direct) 3627000.0 Ops/sec
ChildNodes for-- (into variable) 1934503.8 Ops/sec
ChildNodes for-- (direct) 3230638.2 Ops/sec
lastElementChild previousElementChild 13032203.0 Ops/sec
children-- (into variable) 5470984.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)