Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Linux
Desktop
7 months ago
Test name Executions per second
childNodes foreach 1392637.9 Ops/sec
children (direct) 2015390.4 Ops/sec
firstChild nextSibling 9048467.0 Ops/sec
firstElementChild nextElementChild 12241824.0 Ops/sec
ChildNodes for (into variable) 3638109.8 Ops/sec
children-- (direct) 3274403.8 Ops/sec
ChildNodes for-- (into variable) 1629978.4 Ops/sec
ChildNodes for-- (direct) 4481227.5 Ops/sec
lastElementChild previousElementChild 12311132.0 Ops/sec
children-- (into variable) 7398285.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)