Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Windows
Desktop
2 years ago
Test name Executions per second
childNodes foreach 2116410.2 Ops/sec
children (direct) 2429590.8 Ops/sec
firstChild nextSibling 4766622.5 Ops/sec
firstElementChild nextElementChild 14588702.0 Ops/sec
ChildNodes for (into variable) 2096425.6 Ops/sec
children-- (direct) 4035668.0 Ops/sec
ChildNodes for-- (into variable) 2227973.8 Ops/sec
ChildNodes for-- (direct) 3471319.2 Ops/sec
lastElementChild previousElementChild 13767418.0 Ops/sec
children-- (into variable) 5697924.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)