HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 49 community runs

Desktop Results:
Chrome 44 runs
firstElementChild nextElementChild
9.2M/s
lastElementChild previousElementChild
8.6M/s
firstChild nextSibling
6.4M/s
children-- (into variable)
4.8M/s
ChildNodes for-- (direct)
3.1M/s
ChildNodes for (into variable)
2.6M/s
children-- (direct)
2.3M/s
children (direct)
1.4M/s
ChildNodes for-- (into variable)
1.3M/s
childNodes foreach
969K/s

Fastest: firstElementChild nextElementChild (9.5x faster)

View exact numbers
  • firstElementChild nextElementChild: 9,235,367 ops/sec
  • lastElementChild previousElementChild: 8,606,398 ops/sec
  • firstChild nextSibling: 6,399,250 ops/sec
  • children-- (into variable): 4,780,996 ops/sec
  • ChildNodes for-- (direct): 3,088,043 ops/sec
  • ChildNodes for (into variable): 2,595,681 ops/sec
  • children-- (direct): 2,284,672 ops/sec
  • children (direct): 1,375,901 ops/sec
  • ChildNodes for-- (into variable): 1,274,656 ops/sec
  • childNodes foreach: 968,719 ops/sec
Firefox 5 runs
firstElementChild nextElementChild
48.0M/s
lastElementChild previousElementChild
45.6M/s
firstChild nextSibling
22.1M/s
children-- (into variable)
11.4M/s
children-- (direct)
8.9M/s
ChildNodes for-- (direct)
6.0M/s
children (direct)
5.6M/s
ChildNodes for-- (into variable)
5.0M/s
ChildNodes for (into variable)
4.2M/s
childNodes foreach
3.4M/s

Fastest: firstElementChild nextElementChild (14.2x faster)

View exact numbers
  • firstElementChild nextElementChild: 48,043,380 ops/sec
  • lastElementChild previousElementChild: 45,576,992 ops/sec
  • firstChild nextSibling: 22,137,484 ops/sec
  • children-- (into variable): 11,370,601 ops/sec
  • children-- (direct): 8,896,792 ops/sec
  • ChildNodes for-- (direct): 6,044,884 ops/sec
  • children (direct): 5,613,930 ops/sec
  • ChildNodes for-- (into variable): 5,037,688 ops/sec
  • ChildNodes for (into variable): 4,171,763 ops/sec
  • childNodes foreach: 3,375,417 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    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)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36 Edg/151.0.0.0
Chrome 151 on Windows
View result in a separate tab
firstElementChild nextElementChild
15.4M/s
lastElementChild previousElementChild
14.5M/s
children-- (into variable)
8.4M/s
firstChild nextSibling
7.2M/s
ChildNodes for-- (direct)
4.0M/s
children-- (direct)
4.0M/s
ChildNodes for (into variable)
3.5M/s
children (direct)
2.4M/s
ChildNodes for-- (into variable)
2.3M/s
childNodes foreach
1.3M/s
View exact numbers
Test name Executions per second
firstElementChild nextElementChild 15,355,374 Ops/sec
lastElementChild previousElementChild 14,529,700 Ops/sec
children-- (into variable) 8,430,285 Ops/sec
firstChild nextSibling 7,216,320 Ops/sec
ChildNodes for-- (direct) 4,044,752 Ops/sec
children-- (direct) 4,030,267 Ops/sec
ChildNodes for (into variable) 3,468,432 Ops/sec
children (direct) 2,427,461 Ops/sec
ChildNodes for-- (into variable) 2,267,155 Ops/sec
childNodes foreach 1,336,437 Ops/sec