Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15
Safari 17
Mac OS X 10.15.7
Desktop
9 months ago
Test name Executions per second
childNodes foreach 5393262.5 Ops/sec
children (direct) 2804549.8 Ops/sec
firstChild nextSibling 17973534.0 Ops/sec
firstElementChild nextElementChild 20063390.0 Ops/sec
ChildNodes for (into variable) 6964471.5 Ops/sec
children-- (direct) 4624384.5 Ops/sec
ChildNodes for-- (into variable) 2773575.0 Ops/sec
ChildNodes for-- (direct) 8358234.0 Ops/sec
lastElementChild previousElementChild 20353082.0 Ops/sec
children-- (into variable) 12151211.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)