Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118
Windows
Desktop
7 months ago
Test name Executions per second
childNodes foreach 2612423.5 Ops/sec
children (direct) 3191530.2 Ops/sec
firstChild nextSibling 9620787.0 Ops/sec
firstElementChild nextElementChild 23066782.0 Ops/sec
ChildNodes for (into variable) 2982549.2 Ops/sec
children-- (direct) 5486082.5 Ops/sec
ChildNodes for-- (into variable) 3059756.0 Ops/sec
ChildNodes for-- (direct) 5153246.5 Ops/sec
lastElementChild previousElementChild 21527586.0 Ops/sec
children-- (into variable) 9014257.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)