Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Linux
Desktop
one year ago
Test name Executions per second
childNodes foreach 552881.2 Ops/sec
children (direct) 983274.0 Ops/sec
firstChild nextSibling 5415367.5 Ops/sec
firstElementChild nextElementChild 7352953.5 Ops/sec
ChildNodes for (into variable) 1776774.8 Ops/sec
children-- (direct) 1608319.6 Ops/sec
ChildNodes for-- (into variable) 828812.7 Ops/sec
ChildNodes for-- (direct) 2070933.6 Ops/sec
lastElementChild previousElementChild 6551942.5 Ops/sec
children-- (into variable) 3304013.2 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)