Script Preparation code:
Tests:

Historical Performance Data aggregated from 8 community runs

Desktop Results:
Chrome 8 runs
if/else if
123.1M/s
if/if
122.2M/s
switch case
121.1M/s
View exact numbers
  • if/else if: 123,103,568 ops/sec
  • if/if: 122,212,288 ops/sec
  • switch case : 121,132,864 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
    if/if
    if/else if
    switch case

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0
Chrome 146 on Windows
View result in a separate tab
if/else if
110.1M/s
switch case
108.5M/s
if/if
104.8M/s
View exact numbers
Test name Executions per second
if/else if 110,078,568 Ops/sec
switch case 108,546,736 Ops/sec
if/if 104,835,888 Ops/sec