HTML Preparation code:
Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
for optimized
20.5M/s
for
19.6M/s
reduce
13.8M/s
while
12.6M/s
forEach
7.6M/s
for of
7.5M/s
for in
529K/s

Fastest: for optimized (38.7x faster)

View exact numbers
  • for optimized : 20,464,672 ops/sec
  • for: 19,648,852 ops/sec
  • reduce : 13,779,491 ops/sec
  • while: 12,564,536 ops/sec
  • forEach: 7,618,320 ops/sec
  • for of: 7,520,770 ops/sec
  • for in: 528,667 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
    forEach
    for
    for optimized
    reduce
    while
    for in
    for of

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36
Chrome Mobile 138 on Android
View result in a separate tab
while
4.1M/s
for
3.7M/s
for optimized
3.7M/s
reduce
3.0M/s
for of
2.7M/s
forEach
1.5M/s
for in
160K/s
View exact numbers
Test name Executions per second
while 4,069,422 Ops/sec
for 3,686,427 Ops/sec
for optimized 3,683,025 Ops/sec
reduce 2,979,076 Ops/sec
for of 2,687,480 Ops/sec
forEach 1,468,710 Ops/sec
for in 160,292 Ops/sec