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-- | |
forEach |
Test name | Executions per second |
---|---|
For loop, basic | 34.3 Ops/sec |
While loop, basic | 33.9 Ops/sec |
For loop, cached (inside for statement) | 45.5 Ops/sec |
For loop, cached (outside for statement) | 45.6 Ops/sec |
For loop, i-- (caching inside for loop) | 43.8 Ops/sec |
For loop, i-- (caching outside for loop) | 39.0 Ops/sec |
While loop, cached | 44.1 Ops/sec |
While loop, i-- | 46.4 Ops/sec |
forEach | 51.7 Ops/sec |