Default For vs For with length caching vs forEachFastest: forEach (2597.2x faster)
5,108,328 ops/sec
2,522 ops/sec
1,967 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Default For | |
| For with length caching | |
| forEach |
| 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 |