Script Preparation code:
Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
for loop
893/s
indexOf
15/s

Fastest: for loop (60.6x faster)

View exact numbers
  • for loop: 893 ops/sec
  • indexOf: 15 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
    for loop
    indexOf

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121 on Windows
View result in a separate tab
for loop
1K/s
indexOf
61/s
View exact numbers
Test name Executions per second
for loop 1,027 Ops/sec
indexOf 61 Ops/sec