Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1
Mobile Safari 17
iOS 17.2.1
Mobile
11 months ago
Test name Executions per second
childNodes foreach 5436124.5 Ops/sec
children (direct) 3078203.5 Ops/sec
firstChild nextSibling 19163708.0 Ops/sec
firstElementChild nextElementChild 17478934.0 Ops/sec
ChildNodes for (into variable) 5674576.5 Ops/sec
children-- (direct) 3465356.8 Ops/sec
ChildNodes for-- (into variable) 1878765.6 Ops/sec
ChildNodes for-- (direct) 3886531.5 Ops/sec
lastElementChild previousElementChild 9125618.0 Ops/sec
children-- (into variable) 1928357.2 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)