Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Windows
Desktop
one year ago
Test name Executions per second
childNodes foreach 2041342.6 Ops/sec
children (direct) 2736923.2 Ops/sec
firstChild nextSibling 13217095.0 Ops/sec
firstElementChild nextElementChild 19299408.0 Ops/sec
ChildNodes for (into variable) 5901772.5 Ops/sec
children-- (direct) 4743734.5 Ops/sec
ChildNodes for-- (into variable) 2529646.2 Ops/sec
ChildNodes for-- (direct) 7447299.0 Ops/sec
lastElementChild previousElementChild 19234146.0 Ops/sec
children-- (into variable) 10426885.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)