Script Preparation code:
Tests:

Historical Performance Data aggregated from 7 community runs

Desktop Results:
Chrome 7 runs
switch case
139.8M/s
if/else
131.3M/s
map lookup
127.4M/s
View exact numbers
  • switch case: 139,793,344 ops/sec
  • if/else: 131,320,440 ops/sec
  • map lookup: 127,407,680 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
    map lookup
    switch case
    if/else

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0
Chrome 147 on Windows
View result in a separate tab
map lookup
98.1M/s
switch case
91.9M/s
if/else
87.9M/s
View exact numbers
Test name Executions per second
map lookup 98,133,840 Ops/sec
switch case 91,938,680 Ops/sec
if/else 87,864,888 Ops/sec