Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/25.0 Chrome/121.0.0.0 Mobile Safari/537.36
Chrome Mobile 121
Android
Mobile
7 months ago
Test name Executions per second
childNodes foreach 849220.2 Ops/sec
children (direct) 1267479.8 Ops/sec
firstChild nextSibling 6012542.0 Ops/sec
firstElementChild nextElementChild 8257404.0 Ops/sec
ChildNodes for (into variable) 2178561.2 Ops/sec
children-- (direct) 2066413.2 Ops/sec
ChildNodes for-- (into variable) 1101116.5 Ops/sec
ChildNodes for-- (direct) 2747494.2 Ops/sec
lastElementChild previousElementChild 8289020.5 Ops/sec
children-- (into variable) 4403146.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)