Filter + ForEach vs ForEach with IfFastest: ForEach with If (1.7x faster)
28,777 ops/sec
17,010 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Filter + ForEach | |
| ForEach with If |
| Test name | Executions per second |
|---|---|
| ✓ ForEach with If | 38,683 Ops/sec |
| Filter + ForEach | 21,297 Ops/sec |