Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110
Linux
Desktop
one year ago
Test name Executions per second
childNodes foreach 1483885.6 Ops/sec
children (direct) 1905774.4 Ops/sec
firstChild nextSibling 5344265.0 Ops/sec
firstElementChild nextElementChild 12396381.0 Ops/sec
ChildNodes for (into variable) 1587433.4 Ops/sec
children-- (direct) 3030383.0 Ops/sec
ChildNodes for-- (into variable) 1570936.1 Ops/sec
ChildNodes for-- (direct) 2499974.2 Ops/sec
lastElementChild previousElementChild 11916066.0 Ops/sec
children-- (into variable) 4588483.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)