Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0
Firefox 111
Linux
Desktop
one year ago
Test name Executions per second
childNodes foreach 2391793.0 Ops/sec
children (direct) 2837149.5 Ops/sec
firstChild nextSibling 7633556.0 Ops/sec
firstElementChild nextElementChild 17275852.0 Ops/sec
ChildNodes for (into variable) 2205079.8 Ops/sec
children-- (direct) 4268962.0 Ops/sec
ChildNodes for-- (into variable) 2052962.9 Ops/sec
ChildNodes for-- (direct) 3751229.5 Ops/sec
lastElementChild previousElementChild 16218766.0 Ops/sec
children-- (into variable) 6723193.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)