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
8 months ago
Test name Executions per second
childNodes foreach 379624.6 Ops/sec
children (direct) 610000.6 Ops/sec
firstChild nextSibling 2694067.5 Ops/sec
firstElementChild nextElementChild 4348673.5 Ops/sec
ChildNodes for (into variable) 1144467.0 Ops/sec
children-- (direct) 1043672.2 Ops/sec
ChildNodes for-- (into variable) 548970.6 Ops/sec
ChildNodes for-- (direct) 1192120.6 Ops/sec
lastElementChild previousElementChild 2988060.5 Ops/sec
children-- (into variable) 1747342.4 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)