try-catch control flow (no exception) vs try-catch control flow (thrown exception) vs if-else (hits if) vs if-else (hits else)Fastest: if-else (hits else) (710.4x faster)
163,488,976 ops/sec
162,239,984 ops/sec
152,002,736 ops/sec
230,126 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| try-catch control flow (no exception) | |
| try-catch control flow (thrown exception) | |
| if-else (hits if) | |
| if-else (hits else) |
| Test name | Executions per second |
|---|---|
| ✓ try-catch control flow (no exception) | 1,069,910,336 Ops/sec |
| if-else (hits else) | 1,060,996,032 Ops/sec |
| if-else (hits if) | 1,060,976,320 Ops/sec |
| try-catch control flow (thrown exception) | 367,212 Ops/sec |