Script Preparation code:
Tests:

Historical Performance Data aggregated from 6 community runs

Desktop Results:
Chrome 6 runs
forEach
5.1M/s
Default For
3K/s
For with length caching
2K/s

Fastest: forEach (2597.2x faster)

View exact numbers
  • forEach: 5,108,328 ops/sec
  • Default For: 2,522 ops/sec
  • For with length caching: 1,967 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
    Default For
    For with length caching
    forEach

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0
Firefox 149 on Windows
View result in a separate tab
forEach
4.3M/s
Default For
2K/s
For with length caching
2K/s
View exact numbers
Test name Executions per second
forEach 4,347,238 Ops/sec
Default For 1,632 Ops/sec
For with length caching 1,613 Ops/sec