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
11 months ago
Test name Executions per second
childNodes foreach 757358.2 Ops/sec
children (direct) 1027434.8 Ops/sec
firstChild nextSibling 5518524.5 Ops/sec
firstElementChild nextElementChild 7664373.0 Ops/sec
ChildNodes for (into variable) 2089800.4 Ops/sec
children-- (direct) 1745578.2 Ops/sec
ChildNodes for-- (into variable) 987469.2 Ops/sec
ChildNodes for-- (direct) 2523056.8 Ops/sec
lastElementChild previousElementChild 7499971.5 Ops/sec
children-- (into variable) 3505174.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)