Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Windows
Desktop
9 months ago
Test name Executions per second
childNodes foreach 699101.1 Ops/sec
children (direct) 1090604.1 Ops/sec
firstChild nextSibling 3719980.5 Ops/sec
firstElementChild nextElementChild 5628644.5 Ops/sec
ChildNodes for (into variable) 1906673.2 Ops/sec
children-- (direct) 1786824.1 Ops/sec
ChildNodes for-- (into variable) 1014658.5 Ops/sec
ChildNodes for-- (direct) 2532670.2 Ops/sec
lastElementChild previousElementChild 6758351.0 Ops/sec
children-- (into variable) 3327495.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)