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 1437175.6 Ops/sec
children (direct) 1684952.9 Ops/sec
firstChild nextSibling 5130589.5 Ops/sec
firstElementChild nextElementChild 11796091.0 Ops/sec
ChildNodes for (into variable) 1542112.2 Ops/sec
children-- (direct) 2883021.2 Ops/sec
ChildNodes for-- (into variable) 1605935.4 Ops/sec
ChildNodes for-- (direct) 2629409.2 Ops/sec
lastElementChild previousElementChild 10271991.0 Ops/sec
children-- (into variable) 4339984.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)