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 5396724.5 Ops/sec
children (direct) 3076757.8 Ops/sec
firstChild nextSibling 15119806.0 Ops/sec
firstElementChild nextElementChild 9441455.0 Ops/sec
ChildNodes for (into variable) 3128856.5 Ops/sec
children-- (direct) 2369867.5 Ops/sec
ChildNodes for-- (into variable) 1627285.0 Ops/sec
ChildNodes for-- (direct) 815340.2 Ops/sec
lastElementChild previousElementChild 1878037.6 Ops/sec
children-- (into variable) 1159473.4 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)