Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Linux
Desktop
8 months ago
Test name Executions per second
childNodes foreach 1247668.9 Ops/sec
children (direct) 1805589.8 Ops/sec
firstChild nextSibling 8302457.0 Ops/sec
firstElementChild nextElementChild 11560995.0 Ops/sec
ChildNodes for (into variable) 3425932.0 Ops/sec
children-- (direct) 2919851.5 Ops/sec
ChildNodes for-- (into variable) 1530747.9 Ops/sec
ChildNodes for-- (direct) 4359818.5 Ops/sec
lastElementChild previousElementChild 12030198.0 Ops/sec
children-- (into variable) 6650746.5 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)