Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.0 Safari/537.36
Chrome 84
Linux
Desktop
2 years ago
Test name Executions per second
childNodes foreach 724627.2 Ops/sec
children (direct) 1209581.6 Ops/sec
firstChild nextSibling 7235254.5 Ops/sec
firstElementChild nextElementChild 9891143.0 Ops/sec
ChildNodes for (into variable) 1996713.2 Ops/sec
children-- (direct) 2011698.0 Ops/sec
ChildNodes for-- (into variable) 1124731.8 Ops/sec
ChildNodes for-- (direct) 2669521.0 Ops/sec
lastElementChild previousElementChild 10125795.0 Ops/sec
children-- (into variable) 4356403.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)