Test case name | Result |
---|---|
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 |
Test name | Executions per second |
---|---|
Simple for loop | 9672.6 Ops/sec |
Simple for loop (reverse) | 822.0 Ops/sec |
Array.forEach | 8897.6 Ops/sec |
for loop + Array.entries | 449.8 Ops/sec |
while + Array.entries | 443.8 Ops/sec |
enumerable for loop (order not important) | 45.1 Ops/sec |
enumerable for loop (order is respected) | 366.7 Ops/sec |
Array.map | 748.7 Ops/sec |
Array.filter | 625.1 Ops/sec |
while + Array.entries (condensed) | 693.2 Ops/sec |
for loop + Array.entries (condensed) | 686.8 Ops/sec |
Simple for loop (condensed) | 9572.2 Ops/sec |
Instructionless for loop | 9568.6 Ops/sec |