Test case name | Result |
---|---|
reduce with forEach | |
flatMap | |
reduce with forEach (directly) | |
flat | |
reduce with apply | |
for with foreach | |
for with apply | |
nested for | |
reduce with while | |
while with foreach | |
while with apply | |
while with for | |
nested while | |
nested reduce | |
reduce with while plus |
Test name | Executions per second |
---|---|
reduce with forEach | 3556.3 Ops/sec |
flatMap | 6194.9 Ops/sec |
reduce with forEach (directly) | 3946.8 Ops/sec |
flat | 3164.8 Ops/sec |
reduce with apply | 533.8 Ops/sec |
for with foreach | 590.8 Ops/sec |
for with apply | 292.5 Ops/sec |
nested for | 667.0 Ops/sec |
reduce with while | 9439.8 Ops/sec |
while with foreach | 1029.0 Ops/sec |
while with apply | 372.3 Ops/sec |
while with for | 524.4 Ops/sec |
nested while | 883.2 Ops/sec |
nested reduce | 2536.2 Ops/sec |
reduce with while plus | 16084.6 Ops/sec |