Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
if-else (hits else)
163.5M/s
try-catch control flow (no exception)
162.2M/s
if-else (hits if)
152.0M/s
try-catch control flow (thrown exception)
230K/s

Fastest: if-else (hits else) (710.4x faster)

View exact numbers
  • if-else (hits else): 163,488,976 ops/sec
  • try-catch control flow (no exception): 162,239,984 ops/sec
  • if-else (hits if): 152,002,736 ops/sec
  • try-catch control flow (thrown exception): 230,126 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    try-catch control flow (no exception)
    try-catch control flow (thrown exception)
    if-else (hits if)
    if-else (hits else)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Android 12; Mobile; rv:140.0) Gecko/140.0 Firefox/140.0
Firefox Mobile 140 on Android
View result in a separate tab
try-catch control flow (no exception)
1069.9M/s
if-else (hits else)
1061.0M/s
if-else (hits if)
1061.0M/s
try-catch control flow (thrown exception)
367K/s
View exact numbers
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