Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Windows
Desktop
9 months ago
Test name Executions per second
childNodes foreach 1727472.2 Ops/sec
children (direct) 2353455.0 Ops/sec
firstChild nextSibling 11198735.0 Ops/sec
firstElementChild nextElementChild 15448249.0 Ops/sec
ChildNodes for (into variable) 5123508.5 Ops/sec
children-- (direct) 3912739.8 Ops/sec
ChildNodes for-- (into variable) 2151448.8 Ops/sec
ChildNodes for-- (direct) 6367166.0 Ops/sec
lastElementChild previousElementChild 15629633.0 Ops/sec
children-- (into variable) 9458429.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)