Script Preparation code:
Tests:

Historical Performance Data aggregated from 66 community runs

Desktop Results:
Chrome 49 runs
Switch
8.8M/s
If
4.3M/s

Fastest: Switch (2.0x faster)

View exact numbers
  • Switch: 8,775,535 ops/sec
  • If: 4,318,488 ops/sec
Firefox 10 runs
Switch
86.4M/s
If
3.4M/s

Fastest: Switch (25.6x faster)

View exact numbers
  • Switch: 86,428,016 ops/sec
  • If: 3,380,214 ops/sec
Mobile Results:
Chrome 7 runs
Switch
3.3M/s
If
1.4M/s

Fastest: Switch (2.4x faster)

View exact numbers
  • Switch: 3,333,857 ops/sec
  • If: 1,395,371 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
    Switch
    If

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0
Chrome 144 on Windows
View result in a separate tab
Switch
14.3M/s
If
7.2M/s
View exact numbers
Test name Executions per second
Switch 14,325,222 Ops/sec
If 7,229,917 Ops/sec