Script Preparation code:
Tests:
  • for

  • for (less closure)

  • for of

  • for of (less closure)

  • forEach

  • forEach (less closure)

  • reduce

  • reduce (less closure)

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    for
    for (less closure)
    for of
    for of (less closure)
    forEach
    forEach (less closure)
    reduce
    reduce (less closure)

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4243.0 Safari/537.36
Chrome 87 on Windows
View result in a separate tab
Test name Executions per second
for 661.3 Ops/sec
for (less closure) 684.6 Ops/sec
for of 3898.0 Ops/sec
for of (less closure) 3985.0 Ops/sec
forEach 1598.4 Ops/sec
forEach (less closure) 1483.4 Ops/sec
reduce 1543.0 Ops/sec
reduce (less closure) 1499.1 Ops/sec

Recommended literature: