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
one year ago
Test name Executions per second
childNodes foreach 4959863.0 Ops/sec
children (direct) 2919266.0 Ops/sec
firstChild nextSibling 19020736.0 Ops/sec
firstElementChild nextElementChild 16889832.0 Ops/sec
ChildNodes for (into variable) 5517241.5 Ops/sec
children-- (direct) 4370135.0 Ops/sec
ChildNodes for-- (into variable) 2327890.8 Ops/sec
ChildNodes for-- (direct) 7063025.0 Ops/sec
lastElementChild previousElementChild 16485654.0 Ops/sec
children-- (into variable) 10398491.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)