Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15
Safari 17
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
childNodes foreach 5897906.5 Ops/sec
children (direct) 2798240.2 Ops/sec
firstChild nextSibling 17839280.0 Ops/sec
firstElementChild nextElementChild 19970914.0 Ops/sec
ChildNodes for (into variable) 6952351.0 Ops/sec
children-- (direct) 4591774.5 Ops/sec
ChildNodes for-- (into variable) 2712759.2 Ops/sec
ChildNodes for-- (direct) 8641067.0 Ops/sec
lastElementChild previousElementChild 19806046.0 Ops/sec
children-- (into variable) 12261537.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)