Test case name | Result |
---|---|
For loop, basic | |
While loop, basic | |
For loop, cached (inside for statement) | |
For loop, cached (outside for statement) | |
For loop, i-- (caching inside for loop) | |
For loop, i-- (caching outside for loop) | |
While loop, cached | |
While loop, i-- | |
map | |
forEach |
Test name | Executions per second |
---|---|
For loop, basic | 2134.0 Ops/sec |
While loop, basic | 2198.2 Ops/sec |
For loop, cached (inside for statement) | 2927.5 Ops/sec |
For loop, cached (outside for statement) | 3325.2 Ops/sec |
For loop, i-- (caching inside for loop) | 3298.9 Ops/sec |
For loop, i-- (caching outside for loop) | 3220.6 Ops/sec |
While loop, cached | 2067.5 Ops/sec |
While loop, i-- | 2114.1 Ops/sec |
map | 3484.8 Ops/sec |
forEach | 3860.6 Ops/sec |