Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Linux
Desktop
5 months ago
Test name Executions per second
childNodes foreach 687864.3 Ops/sec
children (direct) 1046743.8 Ops/sec
firstChild nextSibling 4819165.0 Ops/sec
firstElementChild nextElementChild 6601049.0 Ops/sec
ChildNodes for (into variable) 1796655.0 Ops/sec
children-- (direct) 1727996.4 Ops/sec
ChildNodes for-- (into variable) 907438.0 Ops/sec
ChildNodes for-- (direct) 2233321.0 Ops/sec
lastElementChild previousElementChild 5916575.5 Ops/sec
children-- (into variable) 3353024.8 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)