Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Mobile Safari/537.36
Chrome Mobile 127
Android
Mobile
5 months ago
Test name Executions per second
Simple for loop 2986.1 Ops/sec
Simple for loop (reverse) 2871.0 Ops/sec
Array.forEach 17707.1 Ops/sec
for loop + Array.entries 4700.1 Ops/sec
while + Array.entries 4781.8 Ops/sec
enumerable for loop (order not important) 2454.8 Ops/sec
enumerable for loop (order is respected) 1100.2 Ops/sec
Array.map 14176.8 Ops/sec
Array.filter 11708.5 Ops/sec
while + Array.entries (condensed) 5001.8 Ops/sec
for loop + Array.entries (condensed) 5041.6 Ops/sec
Simple for loop (condensed) 2983.7 Ops/sec
Instructionless for loop 2976.5 Ops/sec
Script Preparation code:
Tests:
  • Simple for loop

  • Simple for loop (reverse)

  • Array.forEach

  • for loop + Array.entries

  • while + Array.entries

  • enumerable for loop (order not important)

  • enumerable for loop (order is respected)

  • Array.map

  • Array.filter

  • while + Array.entries (condensed)

  • for loop + Array.entries (condensed)

  • Simple for loop (condensed)

  • Instructionless for loop