Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Windows
Desktop
3 months ago
Test name Executions per second
childNodes foreach 782140.8 Ops/sec
children (direct) 1219739.2 Ops/sec
firstChild nextSibling 6081241.5 Ops/sec
firstElementChild nextElementChild 8450930.0 Ops/sec
ChildNodes for (into variable) 2270911.0 Ops/sec
children-- (direct) 2026870.8 Ops/sec
ChildNodes for-- (into variable) 1048279.4 Ops/sec
ChildNodes for-- (direct) 2760623.2 Ops/sec
lastElementChild previousElementChild 8101027.0 Ops/sec
children-- (into variable) 4296063.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)